TJW wrote in message ...
Please forgive a C programming who has been lurking for a while
to refresh his OO memory ... but what specifically will this print
and why? I see the recursive call, but am not used to initializing
variables in a function declaration ... will array be 43 always or
42, 43, 44, ... and with cout << will the integers be translated
into ASCII characters?
Sorry to ruin a good joke that I don't get ...
Thanks,
TJW
I agree with the explanation that MeDevil gave you, so, I won't repeat it
here.
[ If you still 'don't get it', ask more. ]
To help you 'decode' the message, here is the code I used to get the numbers:
std::string Rev("< the secret string was here >");
std::reverse(Rev.begin(), Rev.end());
for(size_t i(0); i < Rev.size(); ++i){
std::cout<<int( Rev.at(i) )<<" ";
}
std::cout<<std::endl;
You could get back the 'ASCII' with something like:
std::cout<<char(65)<<char(110)<<std::endl; // etc.
The default parameter in the arg list (int array = 43) is just for
distraction, it don't do nuthin' <G>
Coming to C++ from C? Do you know about Mr. Eckel's book? (It was pretty much
designed to take you from C to C++)
Get "Thinking in C++", 2nd ed. Volume 1(&2) by Bruce Eckel
(available for free here. You can buy it in hardcopy too.):
http://www.mindview.net/Books/TICPP/ThinkingInCPP2e.html