I was trying to read this code and see what it does and I know it is a fuction to a bigger code and is passed some arguments I just had a couple of questions. the first one is temp part of the language since they didn't declare it and the part of the code in bold im not sure what those lines do. Can anyone help
string::size_ty pe loc;
if(loc==string: :npos);
string::size_ty pe loc;
if(loc==string: :npos);
Code:
vector<string> split(const string& temp, char s) { string find; vector<string> _find; [B]string::size_type loc;[/B] for(int i=0,j=0;i<temp.size(); i++) { find.clear(); loc = temp.find(s,i); [B]if(loc==string::npos)[/B] return _find; while(j!=loc) { find += temp[j]; j++; } i += j; _find.push_back(find); } return _find; }
Comment