#include<stdio.h>
typedef union intorfloat{
short int i;
float j;
}int_float;
int main(void){
int_float n;
n.i=100;
n.j=200.0;
printf("i=d, sizeof(n)=%d",n.i,sizeof(n));
}
<!--[if !supportEmptyParas]--> <!--[endif]-->
<!--[if !supportEmptyParas]--> <!--[endif]-->
<!--[if !supportEmptyParas]--> <!--[endif]-->
<!--[if !supportEmptyParas]--> <!--[endif]-->
n.j = 200을 해버렸으니깐 i라는 놈은 이제 못써먹는거고 엉뚱한 값이 나온다는건 아는데
그 엉뚱한 값이 몇인지 까지는 안배웠거든요
이거 어떻게 푸 는건가요?
그게바로 태만이다 - dc App