Question: In C language please. /* Fix the ??? in the following code so that it creates a string str and copies hakuna matata! into it.

In C language please.

/*

Fix the ??? in the following code so that it creates a string str and copies "hakuna matata!" into it.

*/

/*

After confirming your fix works, change the code to use heap memory instead of the stack. Remember, everything you malloc you must also free!

*/

#include

#include

#include

void main() {

char str[???];

strcpy( ??? , "hakuna matata!");

// strcpy takes a char * as the first argument

// What should the first argument be?

printf("%s ", str);

// Anything else?

}

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!