Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Language

Compiler

Options

noname-1

$
prog.c: In function 'main':
prog.c:17:22: warning: format '%p' expects argument of type 'void *', but argument 2 has type 'student {aka struct student_tag}' [-Wformat=]
  printf("pdata[0] = %p\n", pdata[0]); //先頭のアドレスから0個離れてるはずなのに先頭のアドレスと違う?
                     ~^     ~~~~~~~~
prog.c:18:22: warning: format '%p' expects argument of type 'void *', but argument 2 has type 'student {aka struct student_tag}' [-Wformat=]
  printf("_data[0] = %p\n\n", data[0]); //pdata[0]と同じアドレス? そもそも何者?
                     ~^       ~~~~~~~
prog.c:21:22: warning: format '%p' expects argument of type 'void *', but argument 2 has type 'student {aka struct student_tag}' [-Wformat=]
  printf("pdata[1] = %p\n", pdata[1]); //謎
                     ~^     ~~~~~~~~
prog.c:22:22: warning: format '%p' expects argument of type 'void *', but argument 2 has type 'student {aka struct student_tag}' [-Wformat=]
  printf("_data[1] = %p\n\n", data[1]); //謎
                     ~^       ~~~~~~~
prog.c:25:22: warning: format '%p' expects argument of type 'void *', but argument 2 has type 'student {aka struct student_tag}' [-Wformat=]
  printf("pdata[2] = %p\n", pdata[2]); //謎
                     ~^     ~~~~~~~~
prog.c:26:22: warning: format '%p' expects argument of type 'void *', but argument 2 has type 'student {aka struct student_tag}' [-Wformat=]
  printf("_data[2] = %p\n\n", data[2]); //謎
                     ~^       ~~~~~~~
_data___ = 0x7ffc33a2a6a0
pdata___ = 0x7ffc33a2a6a0
&data[0] = 0x7ffc33a2a6a0
pdata[0] = 0x1
_data[0] = 0x1

&data[1] = 0x7ffc33a2a724
pdata[1] = 0x1
_data[1] = 0x1

&data[2] = 0x7ffc33a2a7a8
pdata[2] = 0x1
_data[2] = 0x1

data[0].name = MARIO
pdata[0].name = MARIO
Exit Code:
0