Thursday, July 9, 2009

Program in C for the standard function "strncmp()"?

program in C for the standard function "strncmp()"

Program in C for the standard function "strncmp()"?
Here is a link that lists the source code, in C, for this and many other functions.





http://en.wikibooks.org/wiki/C_Programmi...
Reply:Hi!





Definition:


The function strncmp compares characters of two strings.





Example:


#include %26lt;stdio.h%26gt;


#include %26lt;stdlib.h%26gt;


#include %26lt;string.h%26gt;





void main(int argc, char *argv[])


{


if(argc != 3){


printf("Incorrect number of parameters");


exit(1);


}





if(!strncmp(argv[1], argv[2], 8)) /* Compare 8 chars */


printf("Same name os files!");


}
Reply:Sorry dont know try looking it up online





Mickie

snapdragon2

No comments:

Post a Comment