真的是活见鬼了,这个问题怎么回事?
#include <stdio.h>
typedef struct
{
char c1;
char c2;
int n;
} stru;
void main()
{
printf("%d %d %d", sizeof(char), sizeof(int), sizeof(stru));
char s[] = "%.16f";
printf(s,1.1);
}
在VC6中死活就不能编译,
F:\MyProject\testff\aa.c(12) : error C2143: syntax error : missing ';' before 'type'
F:\MyProject\testff\aa.c(13) : error C2065: 's' : undeclared identifier
F:\MyProject\testff\aa.c(13) : warning C4047: 'function' : 'const char *' differs in levels of indirection from 'int '
F:\MyProject\testff\aa.c(13) : warning C4024: 'printf' : different types for formal and actual parameter 1
Error executing cl.exe.
testff.exe - 2 error(s), 2 warning(s)
如果把main()中的第一句注释掉,或者把后两句注释掉,都能通过。