< previous page page_a10 next page >

Page A10
Effect:
Function return value:
Note:
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
fromStr, including the null character \0, is concatenated (joined) to the end of toStr.
The base address of toStr
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
Programmers usually ignore the function return value, using the syntax of a void function call rather than a value-returning function call.
strcmp(str1, str2)
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
Parameters:
Function return value:
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
Strings (null-terminated char arrays) str1 and str2
An int value < 0, if str1 < str2 lexicographically
The
int value 0, if str1 = str2 lexicographically
An
int value > 0, if str1 > str2 lexicographically
strcpy(toStr, fromStr)
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
Parameters:
Effect:
Function return value:
Note:
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
toStr is a char array and fromStr is a string (null-terminated char array), and toStr must be large enough to hold the result.
fromStr, including the null character \0, is copied to toStr, overwriting what was there.
The base address of toStr
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
Programmers usually ignore the function return value, using the syntax of a void function call rather than a value-returning function call.
strlen(str)
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
Parameters:
Function return value:
A string (null-terminated char array) str
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
An int value > 0 that is the length of str (excluding the \0)

Appendix D Syntax Templates
The syntax templates in this appendix describe most, but not all, of the C++ language. To save space, some language features that are not discussed in this book have been omitted.
Each syntax template is labeled with a name. Within a syntax template, boldface words and symbols are literal symbols in the C++ language, and each nonboldface word can be replaced by another syntax template. Items that are shaded are optional. Three dots () mean that the preceding symbol or shaded block can be repeated. A (nonboldface) brace indicates a list of items from which any one can be chosen.

 
< previous page page_a10 next page >