"Anthony Stewart" <24*0*5*
9@s*u*e*t*u*a*e*u*a*> wrote:
> Hi, I know the memory struct given to us is an unnamed struct but is it okay if we make a new type called struct memory?
> This is how I have defined my struct:
>
> struct memory {
> int process_id;
> int page_num;
> int last_accessed;
> };
>
> Also can you verify this output:
>
> in.txt
> 0 0 0 0 1 0 0 2 3 1 0 2 3 3 2
>
> out.txt
> 0, 1, 2, 3,
> 4, 7, 99, 99,
> 99, 99, 5, 99,
> 99, 99, 6, 99,
> 0,0,5; 0,0,5; 0,1,6; 0,1,6; 0,2,10; 0,2,10; 0,3,3; 0,3,3; 1,0,4; 1,0,4; 2,2,14; 2,2,14; 3,2,13; 3,2,13; 1,1,9; 1,1,9;
I got the same output, so it's probably correct. In case anyone is looking at this later and wants to know the output for not allowing process pages to be read more than once, the output should be something like this:
0, 1, 2, 3
4, 7, 99, 99
99, 99, 5, 99
99, 99, 6, 99
0,0,0; 0,0,0; 0,1,1; 0,1,1; 0,2,2; 0,2,2; 0,3,3; 0,3,3; 1,0,4; 1,0,4; 2,2,14; 2,2,14; 3,2,13; 3,2,13; 1,1,9; 1,1,9