October 2004
Beginner
408 pages
9h 24m
English
Concatenation is the process of appending one string onto another. It's kind of like addition for words. To perform concatenation, you use the strncat() function:
strncat(string1, string2, length);
This function will append the value of string2 onto the end of string1. It will append up to length number of characters. This length value should correspond to the remaining space in string1. For example:
char string1[25] = "Mary had a "; char string2[] = "little lamb."; strncat(string1, string2, 13);
strn* Functions and OverflowIn earlier C standards, the available string functions were strcat(), strcpy(), and so forth. The problem with these functions is that they allowed for a buffer overflow, a serious ... |
Read now
Unlock full access