C
Carl Daniel [VC++ MVP]
YW said:Here is my code:
char str[1000];
char *tmp = String;
strcpy(str, "abc...."); // "abc,,," ia a char string
with more than 500 characters
My problem is: the char* tmp only gets the first 256
characters from the char array str.
Are you sure? Perhaps the debugger is only showing you the first 256
characters? Does the literal string contain any embedded nulls (\0)? If
so, strcpy will stop at the first embedded null.
You also haven't shown any code at all that references tmp, or clarifies
what "String" is.
-cd