|
-
Sep 9th, 2000, 12:50 PM
#6
Monday Morning Lunatic
I think it's
Code:
char* strncpy(char *dest, const char *source, size_t length);
It copies length characters from source to dest, without adding a terminator.
char is an integral type, so these are equivalent:
Code:
char c;
c = '\0';
c = 0;
It's not platform independence, just convention that strings end with NULL. Although in DOS, they used to end with a '$' symbol (don't ask why - this is still needed in asm).
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
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
|