Hi everyone and good morning :) .
i want to simply read from the linux file "urandom" a random number and print it out on screen.just simple as that.
this function should be in a file called myrandom.c ( myrandom.h must be made also, which has my function dekleration ) . i will have to compile it later to a static libray and to dynamic library, and then write a main program which prints out 5 random numbers using the static library .
and another main program which prints out 5 random numbers using the dynamic library.
i wrote the myrandom.c code and myrandom.h code i dont know if they are correct .
i tested myrandom.c inside a main program and it gives me random number , but its very big .
ist that the right way to grap a random number from the urandom file?
many thanks
#include <myrandom.h>
int myRandom(){
int rNumber = fopen("/dev/urandom","r");
printf("this is a random number from the file urandom : %d", &rNumber);
return rNumber;
// the header file ( myrandom.h ) :
int myRandom();