printing array in function

Jan Kratochvil jan.kratochvil@redhat.com
Fri Sep 3 09:16:00 GMT 2010


On Fri, 03 Sep 2010 11:06:02 +0200, Nicolas Sabouret wrote:
> 1:  void f(int tab[]) {
> 2:    tab[0] = 1;
> 3:  }
> (gdb) p tab     -> (int *) 0xbffff440

I have only an idea by C++:

void f(int (&tab)[2]) {
(gdb) p tab
$1 = (int (&)[2]) @0x7fffffffde50: {-1, -1}


Regards,
Jan



More information about the Gdb mailing list