Skip to content

Commit 0bb1649

Browse files
committed
debugging with gdb
1 parent 1d4a0ff commit 0bb1649

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

prog.18.4.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#include <stdio.h>
2+
3+
int main (void)
4+
{
5+
const int data[5] = {1, 2, 3, 4, 5};
6+
int i, sum;
7+
8+
// infinite loop so we can debug with gdb
9+
for (i = 0; i >= 0; ++i)
10+
sum += data[i];
11+
12+
printf ("sum = %i\n", sum);
13+
14+
return 0;
15+
}

0 commit comments

Comments
 (0)