I’m stuck on Stage #TG6.
I’ve tried adding more flag variables, gave the code to ai for debugging.
Here are my logs:
remote: [tester::#TG6] Expected: "example hello shellscript"
remote: [tester::#TG6] Received: "example hello shellscript"
And here’s a snippet of my code:
else if (args[0]=="echo"){
char quote='\0';
size_t first_quote=input.find_first_of("\"'");
if (first_quote!=string::npos){
string result;
bool is_it_quote=false;
char quote_char='\0';
for (size_t i = 5; i < input.length(); i++){
if (input[i]=='\''||input[i]=='"'){
if (!is_it_quote){
is_it_quote=true;
quote_char=input[i];
}else if (is_it_quote && input[i]==quote_char){
is_it_quote=false;
}
continue;
}
result+=input[i];
}
cout<<result<<endl;
}else{
for (size_t i = 1; i < args.size(); i++){
if(!args.empty()){
cout<<args[i]<<" ";
}
}
cout<<endl;
}
}