
👍🏻 이번 주 수업에서 좋았던 점 Liked
📚 이번 주에 새롭게 배운 점 Learned
[ 출처 | CSAPP ]a.c : c-source / ASCII
(pre-processing by preprocessor)
gcc -E
a.i : intermediate file / ASCII
(compile)
gcc -S
a.s : assembly file / ASCII
gcc -c
a.o : object file / ELF
.TEXT (instruction)
.DATA (초기화O 전역변수)
.BSS(초기화X 전역변수)
.RDATA(:const)
…
( localte / link )
gcc -o
a.exe : executable file / ELF
HDD: +CRT, +libc
RAM: +.heap, +stack
a.bin : binary file / plat data format
[ 출처 | http://codingbank.weebly.com/datatypes.html ]
[ 출처 | https://mirzafahad.github.io/2021-05-08-text-data-bss/ ]#include <stdio.h>
#include <stdlib.h>
int initialized_global = 10; // .data 섹션
int uninitialized_global; // .bss 섹션
static int initialized_static = 20; // .data 섹션
static int uninitialized_static; // .bss 섹션
const char *message = "Hello, World!"; // .rdata 섹션
void function() {
int local_var = 30; // 스택 영역
int *heap_var = (int *)malloc(sizeof(int) * 5); // 힙 영역
if (heap_var != NULL) {
for (int i = 0; i < 5; i++) {
heap_var[i] = i * 10;
}
for (int i = 0; i < 5; i++) {
printf("%d ", heap_var[i]);
}
free(heap_var); // 할당된 메모리 해제
}
}
int main() {
function();
return 0;
}🧐 배운 것에 관련해서 내가 부족했던 점 Lacked
#define _CRT_SECURE_NO_WARNINGS을 사용하며 CRT가 뭐길래 이런 매크로를 작성하나 생각만 했던 지난날이 조금 부끄럽다... 📝 앞으로 무엇을 더 하면 좋을지 Longed for
VEDA 바로가기 : www.vedacademy.co.kr
VEDA(한화비전 아카데미) 영상으로 확인하기 : https://url.kr/zy9afd
본 후기는 VEDA(한화비전 아카데미) 1기 학습 기록으로 작성되었습니다.