|
-
Oct 7th, 2001, 07:48 PM
#26
strchr() is the generic version of looking in a string-
but note - you wanted the first occurrence of \0 - which
in C is really strlen()
memset is easier to use - however the version spaces I gave you is specific version of how memset is implemented in gcc.
FYI -
strstr() is the C version of instr, it will work with single chars as well.
The examples I gave you are all pointer based. If you don't understand 'em Kedaman suggested memset(), which is just fine.
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
|