Question: this is a Makeargs method for C: convert 3D array to 2D Array or dereference the 2D arrsy, i was told the argv parameter passed

this is a Makeargs method for C:

convert 3D array to 2D Array or dereference the 2D arrsy, i was told the argv parameter passed in was a 3D array but im not sure if i heard that correctly..

Step 1 make a copy of S

Step 2 tokenize copy & count tokens using strtok_r

step 3 make a 2D ararat and the # of rows

step 4 tokenize s, dynamically allocate memory for the token, strcopy/strncpy

i have provided some examples and my code of how it works now but i dont think it it working right or if it is supposed to print out what i have. can someone explain this for me? i can provide you with more information as well this is a Makeargs method for C: convert 3D array to 2D

Array or dereference the 2D arrsy, i was told the argv parameter

passed in was a 3D array but im not sure if i

cscd240_w20_lab8.pdf For example, given the following C code int main() char **argv, s [] - "ls -1 file"; int argc; argc = makeargs (s, &argv); printargs (argc, argv); }// end main The results of makeargs would be: argc would be 3. argv[0] would be 'ls' argv[1] would be 'I' argv[2] would be file argv[3] would be "VO You must not waste memory, and any memory you allocate you must for(x = 0; x

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!