Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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 image text in transcribed

image text in transcribed

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Microsoft Outlook 2023

Authors: James Holler

1st Edition

B0BP9P1VWJ, 979-8367217322

Students also viewed these Databases questions

Question

How is slaked lime powder prepared ?

Answered: 1 week ago

Question

Why does electric current flow through acid?

Answered: 1 week ago

Question

What is Taxonomy ?

Answered: 1 week ago

Question

1. In taxonomy which are the factors to be studied ?

Answered: 1 week ago