mirror of
https://github.com/gatieme/LDD-LinuxDeviceDrivers.git
synced 2026-08-19 01:22:36 +08:00
27 lines
630 B
C
27 lines
630 B
C
/*************************************************************************
|
|
> File Name: test.c
|
|
> Author: GatieMe
|
|
> Mail: gatieme@163.com
|
|
> Created Time: Tue 18 Jul 2017 09:08:52 AM CST
|
|
************************************************************************/
|
|
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
|
|
|
|
struct test
|
|
{
|
|
int a;
|
|
int b;
|
|
};
|
|
|
|
int main(int argc, char *argv[])
|
|
{
|
|
int *temp = &(((struct test *)0)->b); // -=> OK
|
|
typeof(((struct test *)0)->b) t1 = 8; // -=> OK
|
|
int t2 = ((struct test *)0)->b;
|
|
printf("temp = %d\n", *temp);
|
|
|
|
return EXIT_SUCCESS;
|
|
}
|