void print(ostream& os, int number)
{
.....
}
int main()
{
....................
print(number)
}
I just added the "......" so signify code. Anyways, I get an error for print(number) stating that the function does not take 1 argument. I understand why it's telling me that.... but I guess my question is: What is "ostream& os" and what does it do in C++?
"Well, I actually believe you're talking about <iostream>. It stands for Input Output Stream. It is a file in the standard C++ library that allows you to recieve user input and output text to screen using cin >> and cout <<. You use it in the preprocessor directive #include <iostream>."
Ok so this is understandable. Normanlly at the top of your code you put: #include <iostream>. So, why would you pass this through a function and, in this case, how can I get rid of this error?
Hey Bazzy... thanks for the reply and the links. I guess I just happened to post last post right after you replied. I've taken a look through the links you have provided earlier today and was still having issues with it. I'm not understanding why I get that error.