C Characters and Strings – Review Lab assignments

Slides:



Advertisements
Similar presentations
EC-111 Algorithms & Computing Lecture #11 Instructor: Jahan Zeb Department of Computer Engineering (DCE) College of E&ME NUST.
Advertisements

Engineering H192 - Computer Programming The Ohio State University Gateway Engineering Education Coalition Lect 16P. 1Winter Quarter Strings Lecture 16.
 2003 Prentice Hall, Inc. All rights reserved Fundamentals of Characters and Strings Character constant –Integer value represented as character.
Strings.
 2000 Prentice Hall, Inc. All rights reserved Fundamentals of Strings and Characters String declarations –Declare as a character array or a variable.
Nirmalya Roy School of Electrical Engineering and Computer Science Washington State University Cpt S 122 – Data Structures Characters and Strings.
Current Assignments Homework 5 will be available tomorrow and is due on Sunday. Arrays and Pointers Project 2 due tonight by midnight. Exam 2 on Monday.
 2000 Prentice Hall, Inc. All rights reserved. Chapter 8 - Characters and Strings Outline 8.1Introduction 8.2Fundamentals of Strings and Characters 8.3Character.
Functions Quick Review What is a Function? A module of code that performs a specific job. Examples: Function that determines the maximum of two numbers.
Chapter 8 Characters and Strings Acknowledgment The notes are adapted from those provided by Deitel & Associates, Inc. and Pearson Education Inc.
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Fundamentals of Strings and Characters Characters.
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Chapter 8 - Characters and Strings Outline 8.1Introduction.
 2000 Prentice Hall, Inc. All rights reserved. Chapter 8 - Characters and Strings Outline 8.1Introduction 8.2Fundamentals of Strings and Characters 8.3Character.
Dale Roberts Department of Computer and Information Science, School of Science, IUPUI CSCI 230 Characters and Strings Literals and Variables Dale Roberts,
 2007 Pearson Education, Inc. All rights reserved C Characters and Strings.
 2007 Pearson Education, Inc. All rights reserved C Characters and Strings.
EPSII 59:006 Spring Introduction Fundamentals of Strings and Characters Character Handling Library String Conversion Functions Standard Input/Output.
C How to Program, 6/e © by Pearson Education, Inc. All Rights Reserved.
CNG 140 C Programming (Lecture set 9) Spring Chapter 9 Character Strings.
 2000 Prentice Hall, Inc. All rights reserved. Chapter 8 - Characters and Strings Outline 8.1Introduction 8.2Fundamentals of Strings and Characters 8.3Character.
CP104 Introduction to Programming File I/O Lecture 33 __ 1 File Input/Output Text file and binary files File Input/output File input / output functions.
Chapter 8 Characters and Strings Associate Prof. Yuh-Shyan Chen Dept. of Computer Science and Information Engineering National Chung-Cheng University.
Dale Roberts Department of Computer and Information Science, School of Science, IUPUI C-Style Strings Strings and String Functions Dale Roberts, Lecturer.
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Introduction Introduce some standard library functions.
 2003 Prentice Hall, Inc. All rights reserved. 11 Fundamentals of Characters and Strings Character constant –Integer value of a character –Single quotes.
Chapter 8 Characters and Strings. Objectives In this chapter, you will learn: –To be able to use the functions of the character handling library ( ctype).
C++ Programming Lecture 19 Strings The Hashemite University Computer Engineering Department (Adapted from the textbook slides)
Dale Roberts Department of Computer and Information Science, School of Science, IUPUI CSCI N305 Characters and Strings Functions.
Characters and Strings
A First Book of ANSI C Fourth Edition Chapter 9 Character Strings.
1 Arrays and Pointers The name of an array is a pointer constant to the first element. Because the array’s name is a pointer constant, its value cannot.
Computer Science: A Structured Programming Approach Using C1 Objectives ❏ To understand the basic properties and characteristics of external files ❏ To.
1 Chapter 8 - Characters and Strings Outline 8.1Introduction 8.2Fundamentals of Strings and Characters 8.3Character Handling Library 8.4String Conversion.
Dale Roberts Department of Computer and Information Science, School of Science, IUPUI CSCI 230 Characters and Strings Dale Roberts, Lecturer Computer Science,
EC-111 Algorithms & Computing Lecture #10 Instructor: Jahan Zeb Department of Computer Engineering (DCE) College of E&ME NUST.
C Characters and Strings
Pointers & Arrays 1-d arrays & pointers 2-d arrays & pointers.
Characters and Strings
C Characters and Strings
Fundamentals of Characters and Strings
Chapter 10 – Characters and Strings
Characters and Strings
Chapter 7 Text Input/Output Objectives
Functions, Part 2 of 2 Topics Functions That Return a Value
Number guessing game Pick a random number between 1 and 10
Quiz 11/15/16 – C functions, arrays and strings
C++, OBJECT ORIENTED PROGRAMMING
Programming Languages -1 (Introduction to C) strings
A First Book of ANSI C Fourth Edition
Programming Fundamentals Lecture #7 Functions
Exercises on String Operations
C Programming:Part 3 Characters and Strings File Processing Exercise.
Chapter 8 - Characters and Strings
2008/11/10: Lecture 16 CMSC 104, Section 0101 John Y. Park
CS 2308 Exam I Review.
INC 161 , CPE 100 Computer Programming
Pointers and Pointer-Based Strings
Dynamic Memory Allocation
Functions, Part 2 of 3 Topics Functions That Return a Value
Chapter: 7-12 Final exam review.
Strings What is a string? It is an array of characters terminated with
Chapter 9: Pointers and String
C++ Programming Lecture 20 Strings
Lecture 19: Working with strings
Characters and Strings Functions
Characters and Strings
Characters and Strings
C Characters and Strings
Functions, Part 2 of 3 Topics Functions That Return a Value
Functions, Part 2 of 3 Topics Functions That Return a Value
Presentation transcript:

C Characters and Strings – Review Lab assignments Lab guide #7 C Characters and Strings – Review Lab assignments

Key points Fundamental of Stings and Character. Character-handling library (ctype). String-conversion functions (stdlib). Standard Input/Output library functions(stdio). String-processing functions of the String-Handling Library (string). Memory functions of the the String-Handling Library.

Fundamentals of Strings and Characters Building blocks of programs Every program is a sequence of meaningfully grouped characters Character constant An int value represented as a character in single quotes 'z' represents the integer value of z Strings Strings are arrays of characters String is a pointer to first character Value of string is the address of first character String definitions char color[] = "blue"; char *colorPtr = "blue"; Inputting strings scanf("%s", word); Remember that strings represented as character arrays end with '\0‘

Character Handling Library #include <ctype.h>

String-Conversion Functions #include <stdlib.h>

Standard Input/Output Library Functions #include <stdio.h>

String Manipulation Functions of the String Handling Library #include <string.h>

Comparison Functions of the String-Handling Library

Search functions of the String-Handling Library

Memory Functions of the String-Handling Library #include <stdlib.h>

Other functions of the string-handling library

Lab assignments Problems Fig. 8.4 Fig 8.13 Fig 8.16 Fig 8.18 Fig 8.23 Fig 8.32 Finish coding the programs (not copy paste) and ask the TAs for checking