Question: Using c code: What line causes the value stored in i to go bad? What is the cause? How could it be fixed?(gdb) list i

Using c code: What line causes the value stored in i to go bad? What is the cause? How could it be fixed?(gdb) list i 1 /* 2 Example file to debug 3 */ 4 5 #include 6 #include 7 #include 8 9 int main (int argc, char *argv[]) { 10 (gdb) list 10 5 #include 6 #include 7 #include 8 9 int main (int argc, char *argv[]) { 10 11 char str2[] "abc"; 12 char str3[] = "def"; 13 int i = 5; 14 char str1[6]; (gdb) break 13 Breakpoint 1 at ox4005ea: file file2debug.c, line 13. (gdb)r lmnopqrstuvwxyz Appending lmnopqrstuvwxyz to ef gives lmnopqrstuvwxyzdef done is 119 while i is 8026488 [Inferior 1 (process 17152) exited normally] (gdb)

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 Programming Questions!