When i build this code with dev c++ ver.4 it runs the program but then immediatly closes the console. what am i supposed to keep the console open?
#include <iostream.h>
int main()
{
cout << "I Love C++";
return 0;
}
When i build this code with dev c++ ver.4 it runs the program but then immediatly closes the console. what am i supposed to keep the console open?
#include <iostream.h>
int main()
{
cout << "I Love C++";
return 0;
}
Go look at the FAQ on pausing applications, or perhaps search for the answer amongst the 800 other similar threads on this board
i use
#include <iostream.h>
#include <stdlib.h>
int main()
{
cout<<"So do I"<<endl; //endl == end line == \n
system("pause");
return 0;
}
this works in dos only, system calls dos commands (or linux commands) depends on what your on. The output would be...
So do I
Press any key to continue...
thats one way.
- 0927
- a.k.a 0 9 two 7
This program is not displaying the time in the correct area
on the DOS screen. I tried it in so many ways without success.
Please help.
Thank you.
Environment: Desktop OS: Win 2K
Here are my codes and the result that I got:
#include <iostream>
#include <time.h>
#include <string.h>
using namespace std;
// this is a good test for displaying time on the pc
// but the time is displayed at the wrong place
void Time(void);
main()
{
Time();
return 0;
}
void Time()
{
time_t now;
now = time(NULL);
cout << ctime(&now);
}
Result displayed on the screen: Sun Jan 27 06:33:51 2002
Time is in the wrong place, time should be after "2002".
Let me know if I am wrong on this.
you're making it to hard for the guy
don't you realize that the kid is a rookie
try this on for size
#include <iostream.h>
#include <conio.h>
#include <conio.c>
int main()
{
textcolor(1);
cout << "Whats up?" << endl;
getch();
return 0;
}
or
#include <iostream.h>
#include <stdio.h>
int main()
{
cout << "I Love C++";
char a = getchar(); //waits input of a char called "a"
return 0;
}