Manipulating Strings 513
17
Quiz ..............................................................................................................
- What is the length of a string, and how can the length be determined?
- Before copying a string, what must you be sure to do?
- What does the term concatenatemean?
- When comparing strings, what is meant by “One string is greater than another
string”? - What is the difference between strcmp()andstrncmp()?
- What is the difference between strcmp()andstrcmpi()?
- What values does isascii()test for?
- Using Table 17.4, which macros would return TRUEforvar?
int var = 1; - Using Table 17.4, which macros would return TRUEforx?
char x = 65; - What are the character-test functions used for?
Exercises ........................................................................................................
- What values do the test functions return?
- What would the atoi()function return if passed the following values?
a.“65”
b.“81.23”
c.“-34.2”
d.“ten”
e.“+12hundred”
f.“negative100” - What would the atof()function return if passed the following?
a.“65”
b.“81.23”
c.“-34.2”
d.“ten”
e.“+12hundred”
f.“1e+3”
28 448201x-CH17 8/13/02 11:13 AM Page 513