This is how mine strcmp function would look like if I'd to implement it from scratch :)
strcmp implementation from scratch
/**
@author: Mathias Van Malderen (tux4life)
*/
int strcmp(const char *s1, const char *s2)
{
while((*s1 && *s2) && (*s1++ == *s2++));
return *(--s1) - *(--s2);
}
mvmalderen
2,072
Postaholic
agamiro
0
Newbie Poster
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
mvmalderen
2,072
Postaholic
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
mvmalderen
commented:
Yup, now I can fully agree on you :)
+8
jephthah
commented:
i'm glad tux agrees with you. :P
+6
Dave Sinkula
2,398
long time no c
Team Colleague
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
Dave Sinkula
2,398
long time no c
Team Colleague
mvmalderen
2,072
Postaholic
Dave Sinkula
2,398
long time no c
Team Colleague
mvmalderen
2,072
Postaholic
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
Dave Sinkula
2,398
long time no c
Team Colleague
Aia
commented:
You are not wasting your time. Those that really want to know are listening.
+8
mvmalderen
commented:
The more you post, the better I understand what you actually mean :)
+8
Ancient Dragon
commented:
If you think you are wasting your time then why not just post a link to a paper that explains what you mean? You just seem to be pissed off at me for some unknown reason.
-5
ibykow
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.