문제 설명
오류: 이 범위에서 '분할'이 선언되지 않았습니다. (error: ‘split’ was not declared in this scope)
I get this compiler error from c++. error: ‘split’ was not declared in this scope. I need help as i am not able to figure out why. Here is my code:
#include <iostream>
using namespace std;
int main()
{
string input;
string line;
cout<< "Enter the input line" << endl;
while (getline(cin, line))
{
if (line == "quit")
break;
input = input + split(line, '#')[0];
}
cout<< "The input entered was: "<<endl;
cout<< input<< endl;
}
참조 솔루션
방법 1:
As Daniel mentioned, split is not part of C++.
You can consider using boost::split
(by Tuffy、bjskishore123)