cout prints from main, but not from a different function won

Greetings all.
I have a problem with cout that doesn't print anything to the screen, or at least one of couts doesn't. I have a program in main that also uses cout, and that works fine. But then I have a separate function declared below main which gets called from main and includes cout, but it won't print anything. What could be the reasons ?
Thank you, T
CODE?
try using std::endl after your cout in main. Thats if u didnt.
Simplified code looks something like this:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <iostream>;
using namespace std;

void function();

int main ()
{

cout << "This prints to the console" << endl;
function();

return 0;
}

void function()
{
cout << "This does not print to the console" << endl;
}
Topic archived. No new replies allowed.