|
-
December 3rd, 2010, 07:31 AM
#1
Difference between strings before and after strncpy
Hello all,
I am reading a string from a database table which has 100 characters.
It reads into the variable correctly like this:
"Steve Taylor"
and has the remaining characters blank, which is correct. It looks like this in the Watch window when I drop the list to see each a character.
However,
looking at the string in the debugger it is something like this:
"Steve Taylor @~@"
and when I perform a strlen on it it return 135 characters despite it only being in a 100 char array.
Can anyone tell me what is going on here and how I can fix it so the data I am using matches the data in the Watch window (and the database!)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|