/*
* a.c
*
* Created on: 2013-7-16
* Author: root
*/
int a = 1;
void test_a()
{
printf("a:%d %d %d\r\n", &a, sizeof(a), a);
}
/*
* b.c
*
* Created on: 2013-7-16
* Author: root
*/
struct { int x; int y; } a;
void test_b()
{
printf("b:%d %d %d %d\r\n", &a, sizeof(a), a.x, a.y);
}
/*
* main.c
*
* Created on: 2013-7-16
* Author: root
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc, char *argv[])
{
test_a();
test_b();
return EXIT_SUCCESS;
}
结果:
b:6294340 8 1 0