Help Please

I tryed posting to my other thread on C++ help but noone was replying so I hope you dont mind I made another one :sailor:

OK so in c++, which I have a compiler for now, I wrote the following source code:

 
#include <iostream>
using namespace std;
 
int main ()
{
cout<<"Hello "; 
cout<<"I'm a c++ program made by... "; 
cout<<"the amazing Matt!"; 
return 0;
}

when I run the program somthing flashes on my screen, I’m not sure if its the program or not but whatever it is it flashes on and off to fast to see

I just want to actualy see the program so that I know it has worked :hat:

can anyone help?

This is a very nice tutorial
http://www.cplusplus.com/doc/tutorial/basic_io.html

Yes i followed a tutorial on that site to write that source code :smirk:
but I think I did somthing wrong as it is flashes on and then off the screen to fast to see it … thats why I posted this here … so that people can help … are we up to speed now? :shifty:

try including “stdio” I remember using something like that when I was doing stuff like you. :smiley:

The program you’re writing is a console screen window that pops up. If you look around options, you can probably get the screen to stay, otherwise just add this at the end of the line.


int main()
{
...
int x;
cin >> x;
}

That’ll prompt you to type in something and assign it as x before it quits.

Alternatively:


int main (int argc, char *argv[])
{
        ...
        system ("pause");
}