User Profile
Add Friend
Add Note
Track User
Send V-Gift
Dont Even.
hurry
Created on 2004-02-22 18:10:57 (#2301750), last updated 2004-05-04
60 comments received, 44 comments posted
Basic Account [Gift]
30 Journal Entries, 0 Tags, 0 Memories, 0 Virtual Gifts, 1 Userpic
| Name: | alphabetizethis |
|---|---|
| Birthdate: | 06-23 |
| Location: | Philadelphia, Pennsylvania, United States |
strncpy was first designed to handle a now-obsolete data structure, the fixed-length, not-necessarily-\0-terminated ``string.'' (A related quirk of strncpy's is that it pads short strings with multiple \0's, out to the specified length.) strncpy is admittedly a bit cumbersome to use in other contexts, since you must often append a '\0' to the destination string by hand. You can get around the problem by using strncat instead of strncpy: if the destination string starts out empty, strncat does what you probably wanted strncpy to do. Another possibility is sprintf(dest, "%.*s", n, source) .
When arbitrary bytes (as opposed to strings) are being copied, memcpy is usually a more appropriate routine to use than strncpy.
Interests (18):
cheeseburgers and french fries, cheesesteaks, copy and paste, dancing, death metal dave, drinking, electronical devices, fight/fight mode, food, friends, girls, metro, nude, pictures, rock and roll, spinning in circles, xnothingcorex, yelling
Friends [View Entries]emodrumsv4, gangleri, killerkiller, killthemovies, meggieandyou, radio_etcetera, signsnatcher84, skaneverdies, w12iotpg, youandwhatarmy
Communities [View Entries]
Feeds [View Entries]