I have a college assignment, which I am asked to implement a "C" program that produces files containing random integers of type long
int
, where random numbers must be between 0 and RAND_MAX
.
They must make files with the following number of random integers, for example: 50000.
This program must have an input parameter that is the number of integers to produce.
As I do not know where to start, I started to do the following code:
#include "stdafx.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc, char * argv[])
{
FILE *fp;
fp = fopen("50000.c", "wb");
argv[50000];
fclose(fp);
}
Can someone give me some tips? This code is to be done later in the Linux terminal.