Linux_system

c++ Linux compile

MasterOfAI 2022. 8. 19. 20:33

기본적으로 아래와 같이 기록해 주어야 함

// test.cpp

 

#include <iostream>

 

using namespace std;

 

int main()

{

    string strLine = "Domain_0_1              = 1, 1";

 

    string str2("*");

    size_t comment = strLine.find(str2);

 

    string::size_type nBeg;

    string::size_type nEndOfColumn;

    string::size_type nEnd;

 

    nBeg = strLine.find_first_not_of(" ="0);

    nEnd = strLine.find_first_of(" =", nBeg);

 

    cout << "nBeg:" << nBeg <<"\n";

    cout << "nEnd:" << nEnd <<"\n";

}

 

 

complie 는 g++ 로

$g++ test.cpp 

그럼 a.exe 파일이 생성됨 

 

'Linux_system' 카테고리의 다른 글

strace : 어떠한 system call 이 호출되었는가?  (0) 2022.08.19
이 분야의 필독서 / 필독 사이트  (0) 2022.08.19
size_t 와 string::size_type  (0) 2022.08.19
MMIO (Memory-mapped I/O)  (0) 2022.08.19
apt 사용법 (link)  (0) 2022.06.01