Runs before main:
d -c 30 /dev/urandom > random.bytes
Access the randomly generated numbers
int main() {
FILE *fp;
int fd = open("random.bytes",O_RDONLY);
fp = fopen("file.txt" , "r");
if (fd < 0) {
fprintf(stderr, "%s\n", strerror(errno));
}
char buffer[8];
//int error = read(fd,buffer,sizeof(buffer) );
if( fgets (buffer,sizeof(buffer), fp)!=NULL ) {
/* writing content to stdout */
puts(buffer);
}
fclose(fp);
if ( error < 0) {
fprintf(stderr, "%s\n", strerror(errno));
}
uint8_t tid = atoi(buffer);
printf("%d\n",tid);
return 0;
}
Output is always 0?