That may be a poorly worded title, but this is what I am confused about. The only online reference I use for C++ is this website:
When I look functions up, it doesn't seem to tell me everything that is available. For instance, when looking the transform function here:
this is the prototype:
What exactly is UnaryFunction f? I know that a unary function is something that operates on only one member (unlike binary operators addition, multiplication, etc). From other code, I have seen that tolower and toupper work there when operating on strings, but what else is available?
iterator transform( iterator start, iterator end, iterator result, UnaryFunction f );
iterator transform( iterator start1, iterator end1, iterator start2, iterator result, BinaryFunction f );
For a day or two I messed around with Windows programming and when searching the MSDN is seemed to explicitly say what options could be placed there. Are there any sites like that are a general C++ reference site and not specific to windows programming?
It seems like the biggest hurdle to programming is understanding the documentation. There certainly isn't a lack of it out there. It's just getting to the point where it all makes sense and you can understand it.
Check this code out:
One more quick question.
// An improved version of the program! ^_^ Good mood...
int main (void)
std::string answer = "twenty";
std::cout << "How many apples did I buy? (word answers):";
std::cin >> answer;
transform(answer.begin(), answer.end(), answer.begin(), tolower);
if(answer != "twenty")
std::cout << "Sorry, you're wrong\n";
std::cout << "Yes, that's correct\n";
Why does this code work without me including the algorithm header? Is it automatically included with the string header?