Instantly share code, notes, and snippets.

@benjholla /puzzle16.c Secret
Created Oct 12, 2018

Embed
What would you like to do?
C Puzzle 16 (spot the bug if one exists)
#include <stdio.h>
#include <string.h>
int main(int argc, char **argv) {
char *secret = "secret";
if (argc < 2) {
printf("Usage: puzzle16 <secret>");
return -1;
}
printf(argv[1]);
if (strcmp(argv[1], secret)) {
printf(" is the secret");
} else {
printf(" is not the secret");
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment