Skip to content

Instantly share code, notes, and snippets.

/program.c Secret

Created Oct 16, 2017
Embed
What would you like to do?
/*
* Prilagojeno po
* https://gist.github.com/emilyst/1af129c80d5d10cdfbde
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
int is_valid(const char* geslo) {
if (strcmp(geslo, "nyan") == 0) {
return 1;
} else {
return 0;
}
}
int main()
{
char* input = malloc(256);
printf("Prosim napiši geslo: ");
scanf("%s", input);
if (is_valid(input)) {
printf("Pravilno!\n");
} else {
printf("Napačno!\n");
}
free(input);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment