#include
#include
typedef struct _node {
struct _node *pnode;
int a;
char b[20];
} node_t;
int main( int argc , char *argv[] )
{
int a;
node_t **pp, spot;
pp = malloc( sizeof( node_t ) );
((node_t*)pp)->a = 8;
strcpy( ((node_t*)pp)->b , "thisisTest" );
spot = *(node_t*)pp;
fprintf( stderr , "a is %d\n" , spot.a );
fprintf( stderr , "b is %s\n" , spot.b );
fprintf( stderr , "sizeof node is %d\n" , sizeof(node_t) );
free(pp);
return 0;
}
컴파일하면 정상적으로 작동하고,동작하지만,