Linux_system

c++ linux compile

MasterOfAI 2022. 12. 9. 23:29

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

// 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 파일이 생성됨