[Valgrind-users] The bug that got away...

2011-11-01 Thread Peter Toft
Hi all Try to find the errors in this C/C++ snippet using valgrind: #include stdio.h /* Save as code.c */ int main(void) { int i=-1,a[2],b[2],c[2]; a[0] = 1; a[1] = 2; b[0] = 3; b[1] = 4; c[0] = 5; c[1] = 6; printf(%i %in,b[i],a[i]); return 0; } Compile using gcc -o bla

Re: [Valgrind-users] The bug that got away...

2011-11-01 Thread Florian Krohm
On 11/01/2011 06:33 PM, Peter Toft wrote: Hi all Try to find the errors in this C/C++ snippet using valgrind: #include stdio.h /* Save as code.c */ int main(void) { int i=-1,a[2],b[2],c[2]; a[0] = 1; a[1] = 2; b[0] = 3; b[1] = 4; c[0] = 5; c[1] = 6; printf(%i

Re: [Valgrind-users] The bug that got away...

2011-11-01 Thread Tom Hughes
On 01/11/11 22:33, Peter Toft wrote: Try to find the errors in this C/C++ snippet using valgrind: #includestdio.h /* Save as code.c */ int main(void) { int i=-1,a[2],b[2],c[2]; a[0] = 1; a[1] = 2; b[0] = 3; b[1] = 4; c[0] = 5; c[1] = 6; printf(%i