Lecture8 - Programming in Programming in C Based on the...

Info icon This preview shows pages 1–8. Sign up to view the full content.

Programming in C Based on the Original Slides from Politehnica International- Computer Engineering Lecture Slides
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

Outline Strings Character Arrays/ Character Strings Initializing Character Strings. The null string. Escape Characters Di l i Ch t St i Displaying Character Strings Inputting Character Strings String processing: Testing Strings for Equality Testing Strings for Equality Comparing Strings Copying Strings Functions in <string.h> String to number conversion functions Character Strings, Structures, and Arrays Example: Simple dictionary program Sorting the dictionary A better search in sorted arrays
Image of page 2
Arrays of characters char word [] = { 'H', 'e', 'l', 'l', 'o', '!' }; To print out the contents of the array word, you run through each element in the array and display it using the %c format characters. To do processings of the word (copy, concatenate two words, etc) you need t h th t l l th f th h t i t i bl ! to have the actual length of the character array in a separate variable !
Image of page 3

Info icon This preview has intentionally blurred sections. Sign up to view the full version.