|
发表于 2006-4-30 13:12:31
|
显示全部楼层
tmp指针赋值吗?
http://www.cplusplus.com/ref/ 的例子:- char * strcat ( char * dest, const char * src );
- Append string.
- Appends src string to dest string. The terminating null character in dest is overwritten by the first
- character of src. The resulting string includes a null-character at end.
- Parameters.
- dest
- Pointer to a null-terminated string with [b]enough space allocated to contain both src and dest.[/b]
- src
- Null-terminated string to append.
- Return Value.
- dest is returned.
- Portability.
- Defined in ANSI-C.
- Example.
- /* strcat example */
- #include <stdio.h>
- #include <string.h>
- int main ()
- {
- char str[80];
- strcpy (str,"strings ");
- strcat (str,"have been ");
- strcat (str,"concatenated.");
- puts (str);
- return 0;
- }
- Output:
- strings have been concatenated.
复制代码 |
|