Last active
August 29, 2015 14:04
-
-
Save gon1332/49ee86360c373876df85 to your computer and use it in GitHub Desktop.
Compare strings in C in a more physical way
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <string.h> | |
#define STRCMP(a, R, b) (strcmp(a,b) R 0) | |
int main(void) | |
{ | |
char *s = "John"; | |
if (STRCMP("john", ==, s)) | |
fputs("The same", stdout); | |
else | |
fputs("Not the same", stdout); | |
fprintf(stdout, "\n%d", STRCMP("Abc", >, "abc")); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment