Please explain what this does generally s = s.substr(0,s.find(\"//\")); s.erase(
ID: 3698666 • Letter: P
Question
Please explain what this does generally
s = s.substr(0,s.find("//"));
s.erase(remove_if(s.begin(), s.end(), [&] (char c){return isspace(static_cast<unsigned char>(c));}),s.end());
while(!s.empty()) {
if(s[0] == '(') {
s.erase(s.begin());
s = s.substr(0,s.find(")"));
for(int j = 0; j < flag.size(); j++) {
if(s.compare(flag[j].lable)==0) {
flag[j].position = counter;
return;
}
}
Lable at(-1, counter, s);
flag.push_back(at);
return;
}
Explanation / Answer
Below is the C++ code for above problem with proper description provided within comments itself.
If you need any other help for this Comment me below. Thanks
C++ code :