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
Get step-by-step solutions from verified subject matter experts
