Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Question 1: Shawn Green made a similar mistake in the Doom source code. We will modify Doom to add our own game data... so we
Question 1: Shawn Green made a similar mistake in the Doom source code. We will modify Doom to add our own game data... so we will copy and paste. Hmm. Without altering any string literals, fix the following code: (You will edit the existing code below) const char* doomwaddir = "/home/wilkie/doom"; char* doomwad = malloc(strlen(doomwaddir)+1+8+1); sprintf(doomwad,"%s/doom.wad", doomwaddir); char* wilkiedoomwad = malloc(strlen(doomwaddir)+1+8+1); sprintf(wilkiedoomwad,"%s/wilkdoom.wad", doomwaddir); Question 2: How many times is memory read in the marked line of the following code: int data = 42; int* dataptr = &data; int** dataptrptr = &dataptr; // The following line: int data_copy = **dataptr
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started