Česky
Kamil Dudka

Tiny programs (C, C++, C#, ...)

File detail

Name:Downloadmain.c [Download]
Location: tiny > IAS > strcmp
Size:610 B
Last modification:2007-08-29 17:44

Source code

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
 
extern int myStrCmp (const char*, const char*);
 
int main (int argc, char *argv[])
{
	printf ("Program myStrCmp by Kamil Dudka (c) 2005. OpenSource\n");
	if (argc<3)
	{
		fprintf (stderr, "Missing parametr. Read the manual if available.\n");
		return EXIT_FAILURE;
	}
	printf ("  myStrCmp(\"%s\",\"%s\") = ", argv[1], argv[2]);
	printf ("%i (moje funkce napsana v asm)\n", myStrCmp (argv[1], argv[2]));
	printf ("  strcmp(\"%s\",\"%s\") = ", argv[1], argv[2]);
	printf ("%i (knihovni funkce)\n\n", strcmp (argv[1], argv[2]));
	return EXIT_SUCCESS;
}