Main Int Iptr1 Int Iptr2 Int Iptr3 Iptr1 Malloc 100 Iptr2 Iptr1 Free Iptr1 Iptr2

Implement (simulate), the lock and keys solution. As a guideline, you should:• Read “m.c” (supplied C file), and retrieve the appropriate tokens then place them into a file called TOKENS.txt as token value pairs on each line of the file.• Read TOKENS.txt and extract:a. Declaration such as Identifier iptr1 and Identifier iptr3 andb. Assignment such as Operator = Identifier iptr2,c. Heap freeing statement such as Keyword free Separator (Identifier iptr3.d. Dereferencing such as Operator Identifer = valueOnce your program is run on the input program “m.c”, it should report on whether there is:• Dangling pointer or• Memory leak possibility

Leave a Reply

Your email address will not be published. Required fields are marked *