I am trying to run a simulation program to test the FIFO alogarithm, howerver my program is just crashing. this is the main, other functions not shown. Can anyone spot for me the problem.Am not so familiar with using the main Argument[ int main(int argc, char *argv[])] I have the testing files in a folder
int main(int argc, char *argv[])
{
FILE *stream;
if (argc != 3)
{
printf("The format is: pager file_name memory_size.\n");
//exit(1);
}
printf("File used %s, resident set size %d\n", argv[1], atoi(argv[2]));
if ((stream = fopen(argv[1], "r")) == NULL)
{
perror("File open failed");
//exit(1);
}
mem_size = atoi(argv[2]);
start_simulation(stream);
fclose(stream);
system("pause");
}