优先级和类型转换实例
1.#include <stdio.h>
int main()
{
int i = -2;
unsigned int j = 1;
if( (i + j) >= 0 )
{
printf("i+j>=0\n");
}
else
{
printf("i+j<0\n");
}
printf("i+j=%d\n", i + j);
return 0;
}
2.#include <stdio.h>
#include <malloc.h>
typedef struct _demo
{
int* pInt;
float f;
} Demo;
int func(int v, int m)
{
return (v & m != 0);
}
int main()
{
Demo* pD = (Demo*)malloc(sizeof(Demo));
int *p[5];
int *f();
int i = 0;
i = 1, 2;
*pD.f = 0;
free(pD);
return 0;
}
/******************************** Stay hungry, Stay foolish. @Rocky ********************************/