Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
C++ .net cout not working?
Name: sabre252 Date: December 16, 2004 at 18:27:05 Pacific OS: Windows XP Pro CPU/Ram: 512mb
Comment:
hi everyone, I have just installed Visual Studio .net, and typed in a basic program (see below) using cout, when I run my program however, I get a blank box with nothing in it! where did my string go??
#include <iostream> using namespace std; int main() {
Name: Don Arnett Date: December 16, 2004 at 20:03:37 Pacific
Reply:
I'm sure that what you get is a console window that pops up and disappears so fast that you can't see what's in it. When you run a console program from the IDE, it opens a console box for the program to run in and the console box closes as soon as the program is done.
If you were to run your program from a command line, you'd see the output. Another option is to add an input line (fgets(), getchar(), etc) after the cout. This will cause the program to stop for some input, so you see the output.
Be sure to come back and let us know if our suggestions helped!
0
Response Number 2
Name: sabre252 Date: December 16, 2004 at 21:28:51 Pacific
Reply:
thanks for the reply! that was indeed what I was seeing, I'll try the inclusion of that code asap. i'll post as soon as I try it
-- Sabre p.s. -- I never noticed this in prior versions of VS? ... ohh well I spent more time with VB..Thanks again!
Summary: Hi, I installed borland C++ version 3.0 in my PC, but the C++ program is not running at all; when I click the turbo C++ to get into that window...nothing works.. C++ window creates freeze situ...
Summary: I noticed that eof() method is not available while working with ifstream objects. Back when I had MS VS 6.0, I've been checking for eof in the following way: ifstream fin ; fin.open("filename") ; whi...
Summary: well i have had .net for a while now and i dont like it. Maybe its just me, but there is someone else that is having the same problem. I used VSC++.net and have not been able to make anything work. It...