변수의 사용 이유와 메모리 점유
This commit is contained in:
16
Practice_03/p03-3.c
Normal file
16
Practice_03/p03-3.c
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
int main(void){
|
||||||
|
int a = 10;
|
||||||
|
unsigned char *p = (unsigned char*)&a;
|
||||||
|
|
||||||
|
printf("int a = %d\n", a);
|
||||||
|
printf("메모리 저장 순서 : \n");
|
||||||
|
|
||||||
|
for(int i = 0; i < sizeof(a); i++){
|
||||||
|
printf("주소 %p : 0x%02X\n", (p + i), p[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user