The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /home/Devil/workplace/test/test
Breakpoint 1, main () at main.cpp:14
(gdb) p a
$9 = {
d = 2.1716590483608889e-305,
a = 4.01951477e-34,
b = 134517456,
c = 75 'K'
}
(gdb) p &a.d
$10 = (double *) 0xbffff6c8
(gdb) p &a.a
$11 = (float *) 0xbffff6d0
(gdb) p &a.b
$12 = (int *) 0xbffff6d4
(gdb) p &a.c
$13 = 0xbffff6d8 "K\222\005\b\364\177\256"
(gdb) s
20
(gdb) l
10
11 int main()
12 {
13 A5 a;
14 std::cout<<sizeof(a)<<std::endl;
15 return 0;
16 }
(gdb)
check output
[
本帖最后由 Devil_W 于 2010-9-2 21:14 编辑 ]