0
I have a college job, which I am asked to implement a "C" program that produces files containing random integer numbers of the type long
int
, where the random numbers must be between 0 and RAND_MAX
.
You should make files with the following number of random integers for example : 50000.
This program must have an input parameter which is the number of integers to produce.
Since I don’t know where to start, I started making 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 on the linux terminal.
Can someone give me some tips ? Turn on your compiler’s warnings and pay attention to them.
– pmg
The problem is that I don’t know which compiler to use on linux could give me the example of some ? But I’m in the right direction ?
– AndreLopes
In principle all Linux has installed gcc. Try
gcc --help
to verify.– pmg
ahahah I know this job :)
– dippas