1 8 1 Introduction Introduce some standard library

1 8. 1 Introduction • Introduce some standard library functions – Easy string and character processing – Programs can process characters, strings, lines of text, and blocks of memory • These techniques used to make – Word processors – Page layout software – Typesetting programs © Copyright 1992– 2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved.

8. 2 Fundamentals of Strings and Characters • 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 – Series of characters treated as a single unit • Can include letters, digits and special characters (*, /, $) – String literal (string constant) - written in double quotes • "Hello" – Strings are arrays of characters • String a pointer to first character • Value of string is the address of first character © Copyright 1992– 2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 2

8. 2 Fundamentals of Strings and Characters • String definitions – Define as a character array or a variable of type char * char color[] = "blue"; char *color. Ptr = "blue"; – Remember that strings represented as character arrays end with '