//comparing s1 and s2; return 0 if strings are equal and number when they are not equal
int strcmp(const char *s1, const char *s2)
{
while (*s1==*s2 )
{
if(*s1=='\0') return 0;
s1++;s2++;
}
return(*s1-*s2);
}
strcmp
Subscribe to:
Post Comments (Atom)
Labels
- Code Request (1)
- Date / time functions (2)
- Elementary Tutorial (2)
- Journals and Publications (1)
- Searching and Sorting (4)
- Series and Numbers (2)
- String functions (4)
Submit Request
If you need some code or programs just post a comment on this post. I will try to provide you the same at the earliest.
About this blog
Free sample code, example code , code snippet , tutorials in C C++. Find, download and reuse the code database available which vary from small programs to large ones as well. Feel free to request for code that is not in the list.
Me & Site Sponsors
About Me | Reach Me |
Sharad Kumar Singh | Feedback |
0 comments:
Post a Comment