in my program,i give each user an ID code but maybe user forget ID, then i want to search his or her name in a way that if i print part of the user's name ,program shows me all of names which have that part then i choose between them.
how can i do that??
|
Mentor
|
![]() |
| 4Jul2009,03:39 | #2 |
|
strstr is a useful function for finding a substring.
|
|
Go4Expert Member
|
|
| 4Jul2009,21:37 | #3 |
|
Mentor
|
![]() |
| 5Jul2009,04:36 | #4 |
|
No, you're thinking of strcmp. strstr is a function that finds substrings of a string, so if you give it the parameters "look it up in the docs bozo" and "docs" then it will give you a pointer to "docs", thus confirming that "docs" is indeed in the string.
|


