results inCode:char str[]="Hello"; // 5 chars char *tmpstr; int size = strlen(str); // 5 tmpstr = new char[size+1]; // char[6] strcpy_s(tmpstr, size, str); <error tmpstr[size]=0;. But i have no clue why. Why do i get this error?
| CodeGuru Home | VC++ / MFC / C++ | .NET / C# | Visual Basic | VB Forums | Developer.com |
|
Results 1 to 8 of 8
Thread: Strcpy/memory allocation problemThreaded View
|
Click Here to Expand Forum to Full Width |