본문 바로가기

컴퓨터 과학 & 영상처리 관련/C / C++

cpp 헤더 동작 원리

header.h

#include <iostream>

int headerTest(int x); 



header.cpp

#include "header.h"

int headerTest(int x)
{
    int a = x * 2;
    return a;    
}

 

main.cpp

#include <cstdlib>

#include <iostream>

#include "header.h"


using namespace std;


int main(int argc, char *argv[])

{

    cout<<headerTest(10)<<endl;

    

    system("PAUSE");   

    

    return EXIT_SUCCESS;

}




devcpp로도 프로젝트 하면 편하구나...배울수록 재밌네






'컴퓨터 과학 & 영상처리 관련 > C / C++' 카테고리의 다른 글

#ifdef, #endef  (0) 2011.12.25
함수포인터  (0) 2011.12.23
c언어 문자열 붙이기  (0) 2011.12.15
cgi는 그냥 c파일을 .exe처럼 .cgi로 컴파일한것뿐임  (0) 2011.12.08
함수포인터  (0) 2011.12.07