Depth-Studios
Welcome guest (Login / Register)
string compare

Definition


bool compare_string(char *string, char *comparison);


Description


Compare both arguments.


Parameters


string
First string to compare.
comparison
String to compare with.


Return Value


Returns true when both strings are equal, otherwise this function will return false.


Example


#include <stdio.h>
#include <libc/string.h>
 
int main(int argc, char *argv[])
{
	if(compare_string("Hello", "World"))
	{
		printf("Hello equals World\n");
	}
	else
	{
		printf("Hello doesn't equals World\n");
	}
 
	return 0;
}


Output:
Hello doesn't equals World