#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/fcntl.h>
int believe(int it, char * you)
{
int random;
int c;
random = open("/dev/random", O_RDONLY);
read(random, &c, sizeof(c));
close(random);
if(!strcmp(you, "people")) {
printf("It doesn’t matter if you guys believe or not\n");
return c;
}
printf("I believe!\n");
return 1;
}
int main()
{
int ret;
int it; /* you know */
char * you = "people";
char * I;
switch(believe(it, you)) {
default:
ret = believe(it, I);
}
if(ret)
printf("It's a miracle!\n");
printf("It just happened!\n");
return 0;
}
More Info