Recent Posts
printf("ho_tari\n");
pointer6 본문
#include <stdio.h>
int main(void)
{
int i = 100;
double d = 3.14;
void *p;
p = &i;
//*p = 200;
*(int *)p = 200;
p = &d;
//*p = 3.14;
*(double *)p = 2.718;
printf("i: %d\td: %f\n", i, d);
return 0;
}
<compile 결과>
'C' 카테고리의 다른 글
pointerAndArray2 (0) | 2023.09.01 |
---|---|
pointerAndArray (0) | 2023.09.01 |
pointer5 (0) | 2023.09.01 |
pointer4 (0) | 2023.09.01 |
pointer3 (0) | 2023.09.01 |