Last active
August 29, 2015 14:14
-
-
Save billowdood/5e530b694ac536488d5f to your computer and use it in GitHub Desktop.
Basic random generation in c
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
//Standard stuff | |
#include <stdio.h> | |
// rand(),srand() | |
#include <stdlib.h> | |
//time() | |
#include <time.h> | |
/* | |
References: | |
http://stackoverflow.com/questions/822323/how-to-generate-a-random-number-in-c | |
http://stackoverflow.com/questions/15458393/implicit-declaration-of-function-time-wimplicit-function-declaration | |
*/ | |
int main(int argi,char** args){ | |
srand(time(NULL)); | |
int r = rand(); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment