|
-
Apr 27th, 2001, 07:26 AM
#1
Thread Starter
Monday Morning Lunatic
Code:
char buf[90];
memset(buf, 0, 90);
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
-
Apr 27th, 2001, 07:42 AM
#2
Guru
Remember that if you want to just make a string empty, you don't have to zero out all the characters, but only the first.
This will make the string pretend it's empty - even strlen will return zero. 
(The string won't really be empty, but most string functions usually think that the string ends at the first zero character)
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
|