Question
If you run the GDB on the following code, you get stuck in CGDB. So while sending text to stdin, figure out a way to
If you run the GDB on the following code, you get stuck in CGDB. So while sending text to stdin, figure out a way to send some input to the program without explicitly providing it while it's running.
*Include a text file containing your input, and remember that you can run things with command line args from the GDB*
C CODE:
____________________________________________________________________________________________
#include
#define MAX_LEN 80
int main (int argc, char *argv[]) { char a_word[MAX_LEN];
printf ("What's your name? "); fgets (a_word, MAX_LEN, stdin); printf("Hello, %sI hope you have a wonderful day. ", a_word);
return 0; } ____________________________________________________________________________________________
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started