i don't have idea who write this, anyone can a help me

closed account (L8boLyTq)
You should do a program from a character array allocated with new simulate the behavior of the operating system when the above functions are invoked. To this must think:
The vector created is RAM.
The functions malloc, realloc, free and memset must be implemented an thinking about the
above.
Void pointers The use certain functions, be simply an a structure (struct), which store the pointer to the name, which begins in the vector "ram" and that taman or has.
You should safeguard the integrity of memory, so each new asignacio n of this (malloc, realloc) must verify that the new memory allocated is free (not previously assigned) and that there is enough space in memory.
The functions to be executed in this "system memory" to be delivered to an trav program is a text file. This text file you make to the teacher at the time of the evaluation on and will have the following format:

The first line contains the number of elements of nu vector "ram".
From there you will have a number of functions encoded with different nu number on each line in the following format:
• To malloc the Odigo c is 1, followed by a string with the name of the pointer and a mere nu indicate size. Eg allocate 8 bytes ptr = 1 8.
• To realloc the Odigo c is 2, followed by a string that is the name of the pointer to be modified and a mere nu is the new size. Eg 10 bytes reassign ptr ptr = 2 10.
• To free the C ODE is 3, followed by a string that is the pointer to remove. Eg release ptr ptr = 3.
• For the Odigo memset c is 4, followed by a string indicating the pointer, merely indicating the value nu and nu another number indicating the num. Eg 0 assigned setear by a ptr the following 2 position = 4 0 2 ptr memory.
• A line beginning with 0, ends the program. An example of this input file to be IA:
100
1 ptr1 10
1 ptr2 10
1 ptr3 10
2 ptr1 50
3 ptr2
4 ptr1 0 10
0
Before finalizing on program to print each of the positions of the vector "ram" to what will do a cast to integer of each of the positions.
Last edited on
Topic archived. No new replies allowed.