카테고리

asm (27) bootloader_x86_grub (1) C (92) compile (11) config (76) CPP (13) CSS (1) debugging (7) gimp (1) Go (1) html (1) Java (1) JavaScript (1) kernel (19) LibreOffice (3) Linux system progamming (21) MFC (1) opencv (4) OpenGL (1) PHP (1) Python (4) qemu (29) shell (3) socket (7) troubleshooting (2) ubuntu18.04 (2) windows (1)

2018/12/05

CPP

example 1
vi foo.cpp
#include <iostream>

using namespace std;

int main(int argc, *argv[]) {
    cout << "Hello World!";

    return 0;
}

example 2
vi foo1.cpp
#include <iostream>

using namespace std;

int main(int argc, *argv[]) {
    cout << "Hello World!" << endl;
    return 0;
}

example 3
#include <iostream> // usr/include/C++/버전/iostream 위치 확인. 

using namesapce std; // std::endl 사용정의 

int main(int argc, *argv[]) {
    cout << "Hello World!" << endl1;
    return 0
}

iostream using 검증 == iostream using 는 곳 C에서 iostream.h 유사한 형식을 가진다. 
vi /usr/include/c++/7/iostream
namespace std _GLIBCXX_VISIBILITY(default)

Compile 
g++ -o foo foo.c
g++ -o foo1 foo.c

댓글 없음:

댓글 쓰기