Declaration과 Definition 분리
main 함수 앞에 선언을 해준다.
-> forward declaration
ex)
int add(int a, int b);
int multiply(int a, int b);
int subtract(int a, int b);
int main()
{
cout << add(1, 2) << endl;
return 0;
}
'C++(홍정모의 따배씨++)' 카테고리의 다른 글
1.12 헤더가드 (0) | 2021.08.05 |
---|---|
1.11 헤더파일 Header File 만들기 (0) | 2021.08.05 |
1.8 연산자와의 첫 만남 (0) | 2021.08.05 |
1.7 지역 범위 Local Scope (0) | 2021.08.05 |
1.6 키워드와 식별자 이름짓기 (0) | 2021.08.05 |
댓글