-
String output
Code:
int main()
{ string s = "12a34b56c78d";
int size = 12;
writeStuff(s,size);
return 0;
} // end main
void writeStuff(string s, int size)
{ if (size > 0)
{ cout << s.substr(size-1, 1);
writeStuff(s, size-3);
} // end if
} // end writeStuff
What is supposed to be the output of this?
-
What the hell? Are you just posting your homework for us to answer? I thought you needed help before so I did but this is the third place you have posted dodgy code asking "Whats the output?"
What do you *think* the output is?
-
Download and install GCC, the GNU Compiler Collection - GNU Project - Free Software Foundation (FSF) and Code::Blocks, then build, link, and run the program, and you have your answer.