I am in the process of writing a project and I cant seem to get cout to work at all. I can however print to a file and use cin, and i have included all the necessary io. whenever i compile the program i have a line

cout << "hi";

but nothing is printed in the command prompt. anyone have any suggestions?

>>anyone have any suggestions?

Post your complete program that illustrates the problem you are having, and also tell us what operating system and compiler you are using. It's possible you might need to call flush() at the end, such as cout << "Hi" << endl; (note that endl also calls flush() )

the program i am writing is only my laptop and i didnt feel like connecting it to the internet so i am posting off of my desktop.

now, i dont know why, but whenever i added a cin above the cout....it worked fine. so i guess i will just continue to write a few extra lines for now until i find the answer.

thank you for the reply.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.