- 论坛徽章:
- 59
|
printf(, *((char *)&a));
pls use printf("%c\n",
assume there are the following code
char [1111]="%x\n";
printf(fmthex,*((char *)&a));
fmthex[1]='c';
printf(fmthex,*((char *)&a));
now you may understand what happy: the compiler doesn't know which type be transport into the function "printf";
which is parsed by the function "printf" itself. and the compiler can't (some compiler can do a few check about function printf & scanf)
understand what happen about the first parameter of printf( which be understand as a formating string).
while use printf, it is your duty to make the program acts right.
wish it helps, thks
|
|