서재

  • 홈
  • 프로그래머

namespace 2

header

기본 개념 1. header 파일 예시 예를들면, test.h 라는 헤더 파일이 있고 안에 namespace { class { function } }이 있다하자. 여기서 어떻게 동작하는지와 같은 자세한 내용은 작성하지 않는다. 즉, 틀만 작성한다. // test.h namespace N { class test { public: void function(); private: int value = 0; }; } 2. .cpp 파일 예시 이제 test.cpp 파일을 만들고 #include "test.h"로 컴파일러에게 test.h에 정의된 내용을 알려준다. header 파일에 틀을 작성했다면, .cpp 파일에는 틀이 어떻게 동작하는지 작성해주면 된다. header 파일에서 function의 기능을 작성하지 않..

프로그래머/CPP_메모 2022.03.16

cpp 입출력과 네임스페이스

입출력과 네임스페이스 using namespace std; int main() { int input; cin >> input; cout input; std::cout

프로그래머/CPP_강의정리 2021.09.05
이전
1
다음
더보기
프로필사진

서재

기록

  • 전체
    • 프로그래머
      • CPP_강의정리
      • CPP_메모
      • visual_studio
    • 독후감

Archives

최근글과 인기글

  • 최근글
  • 인기글

방문자수Total

  • Today :
  • Yesterday :

공지사항

Calendar

«   2026/04   »
일 월 화 수 목 금 토
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30

Tag

template, opp, big-o표기법, delete, namespace, struct, const, CPP, virtual, array, C++, nullptr, modern cpp, Enum, STL, iterator, Pragma once, Overloading, typedef, pointer,

페이스북 트위터 플러그인

  • Facebook
  • Twitter

최근댓글

티스토리툴바