Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 04-19-2005, 09:55 PM   #1 (permalink)
357mag
Registered User
 
Join Date: Mar 2005
Posts: 15
357mag is on a distinguished road
Question about the output window

I picked up a copy of Microsoft Visual C++ 6 off of ebay. I want to start writing console programs so I started a new project and wrote my code and executed my program. This is what is output:

Welcome to C++! Press any key to continue

The "Press any key to continue" is what the compiler adds. Now my question is why is the message "Press any key to continue" displayed on the same line as the output? I actually would prefer it if that message was displayed on it's own line like:

Welcome to C++!
Press any key to continue

Is there any way to change that?
357mag is offline   Reply With Quote
Old 04-19-2005, 10:51 PM   #2 (permalink)
357mag
Registered User
 
Join Date: Mar 2005
Posts: 15
357mag is on a distinguished road
Ah, I got it solved. All I need to do is add endl; or \n at the end.
357mag is offline   Reply With Quote
Old 04-19-2005, 10:56 PM   #3 (permalink)
redhead
Newbie
 
redhead's Avatar
 
Join Date: Jun 2002
Location: Denmark
Posts: 1,705
redhead is on a distinguished road
add a:
Code:
std::cout << std::endl;
after your "Welcome to C++!" So the code would look somethign like this:
Code:
#include <cstdio>


int main()
{
    char wait;
    std::cout << "Welcome to C++!";
    std::cout << std::endl;
    std::cin >> wait;
    return 0;
}
__________________
Don't worry Ma'am, We're university students, We know what We're doing.
-----
If you pull the pin, Mr.Grenade would no longer be your friend.
-----
01000111 01101111 00100000 01000011 00100000 00100001
redhead is offline   Reply With Quote
Old 04-20-2005, 04:16 AM   #4 (permalink)
Valmont
[code][/code] enforcer
 
Valmont's Avatar
 
Join Date: Mar 2003
Location: Netherlands
Posts: 1,544
Valmont is on a distinguished road
If you need an IDE to learn C++ then Dev-cpp is much better and free. The problem is that the compiler and STL is hopelessly out of date.
__________________
Valmont is offline   Reply With Quote
Old 04-20-2005, 11:29 AM   #5 (permalink)
357mag
Registered User
 
Join Date: Mar 2005
Posts: 15
357mag is on a distinguished road
I sent two emails to the webmaster over at Bloodshed. I never got a response. I tried to download Bloodshed but none of the download links worked. Needless to say, I doubt whether I would fork over any money to them in the hopes that they will actually send me their compiler in the mail.
357mag is offline   Reply With Quote
Old 04-20-2005, 01:48 PM   #6 (permalink)
Valmont
[code][/code] enforcer
 
Valmont's Avatar
 
Join Date: Mar 2003
Location: Netherlands
Posts: 1,544
Valmont is on a distinguished road
I'll upload it and then I will send you a link.

Ok check your Private Message for the link.
I have uploaded Dev-Cpp 4.9.9.1. True, version 4.9.9.2 is out as well, but I don't endorse it because it has some crucial bugs. This version one works nicely.

Listen, when you installed it and run it for the first time, it will ask you two things:

1st. To select a visual style. Just pick what you like.
2nd. To choose whether you would like to enable a feature too lookup functions and names and stuff. YOU DO NOT WNAT THAT OPTION. It is terribly buggy.

Alternative

You may be interested in the free but highly advanced Microsoft Visual C++ 2005 Express Beta 2. The link is:
http://lab.msdn.microsoft.com/expres...c/default.aspx
However, you *must* have installed Service Pack 2 for Windows XP (Pro).
__________________
Valmont is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
A question about Visual C++.Net 357mag Standard C, C++ 1 03-30-2005 05:01 AM
Output problem with file manipulation (newbie) crazyant Java 4 03-11-2005 01:03 PM
quick question on fstream toast28 Standard C, C++ 1 02-02-2005 12:13 PM
OpenGL.dll Mr.Anderson Platform/API C++ 3 08-13-2004 10:07 AM
Print window Belisarius HTML, XML, Javascript, AJAX 1 08-05-2003 04:42 AM


All times are GMT -8. The time now is 09:25 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting