Question: Using C programming and UNIX/Linux terminal. ***************************************************************************************************** /* * Program for Question 2 */ #include #include #include #define BUFSIZE 100 int main() { char* mystr;

Using C programming and UNIX/Linux terminal.

Using C programming and UNIX/Linux terminal. ***************************************************************************************************** /* * Program for Question

*****************************************************************************************************

/* * Program for Question 2 */ #include #include #include

#define BUFSIZE 100

int main() { char* mystr; // destination string

strcpy( mystr, "Hello, World!" ); // copy source string to destination puts( mystr ); // output destination string

return( EXIT_SUCCESS ); }

The sample program lab7q2.c compiles with warnings. If one ignores the warnings and executes the resultant executable file anyway, it results in a runtime error (the program "crashes"). Fix the program so that it compiles without warnings and executes without errors. Change only one statement in the program, and make the change as minimal as possible. Do not change any executable statements. Call your modified program lab7q2_fixed.c. You do not need to show a log of editing in your lab7.txt file. Instead, show a diff (1) of the original file and your lab7q2_fixed.c, a clean compilation of lab7q2_fixed.c, and the result of running the resultant binary executable file

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!