-
window closes
When I run this program:
# include <iostream.h>
int main() {
cout<< "abcd\n";
cout<< "Liczba znaków w \"abcd\" = " <<sizeof "abcd";
cout<< "" << endl;
cout<< " Wyrazy przedzielone\t tabulatorem" << "\n";
cout<< " Tekst dwuwierszowy \
w jednym wierszu" ;
}
window closes itself quickly after the program shows the text.
What should I do to be able to read the text and close the window clicking at the right corner. I use Bloodshed Dev C++ 5 beta 9 release (4.9.9.0) compiler.
Thank you in advance.
-
either run it from a "dos box" by start->run->cmd (command on win 98)
or
add
system("pause"); to your code at the end
-
In addition to jonnin's suggestions, you can also read a dummy char to delay output:
//place this code at the end
char dummy;
cin>>dummy;
Danny Kalev
-
system("pause");
return (0);
}
error C2065: 'system' : undeclared identifier
:confused:
-
#include <something> ... look in your help... I don't know what it is, cstdio maybe?
-
-
you can even use getch() function from conio.h before return(0)
Viraj
-
right before the return 0;
put
cin.get();
return 0;
}
then u have to hit enter to close it, its worked pretty well for me
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks