[Home]
[Edit this page]
[Recent Changes]
[Special Pages]
[Help]
VisualCpp2005HelloWorld
First you need to create a project
Change this to
Press CTRL-F5. Done!
Prefer to post this code on forums.
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
VisualCpp2005HelloWorld
(Visual C++ 2005) Hello World
How to make a Hello World program in Visual C++ 2005:First you need to create a project
- Click 'File | New Project'. The 'New Project' window appears
- Choose the Project Type 'Visual C++ | Win32', then the Template 'Visual Studio Installed Templates | Win32 Console Application'
- Type an appropriate name at 'Name', for example 'HelloWorld'. While typing this, the Solution Name can be seen to get the same name, which is okay.
- You can optionally change the location of the project
- You can optionally uncheck the CheckBox 'Create directory for solution', but [[I | Bilderbikkel]] prefer it checked.
- Press OK to start the Win32 Application Wizard
- Click Next in the first screen. You can also click 'Finish' but this can be done if the settings in 'Next' are already set correctly.
- In the next menu screen 'Application Settings', set the Application Type to 'Console Application' .
- Uncheck 'Empty Project'
- Check or uncheck 'Precompiled Header'. In this example, I keep it checked.
- Click Finish to be taken to the Code Editor.
// HelloWorld.cpp : Defines the entry point for the console application. //int _tmain(int argc, _TCHAR* argv[]) { return 0; }
- include "stdafx.h"
Change this to
// HelloWorld.cpp : Defines the entry point for the console application. //int _tmain(int argc, _TCHAR* argv[]) { std::cout << "Hello World" << std::endl; return 0; }
- include "stdafx.h"
- include <iostream>
Press CTRL-F5. Done!
Note
The main function above is not standard. The standard-conform code would be:// HelloWorld.cpp : Defines the entry point for the console application. //int main() { std::cout << "Hello World" << std::endl; }
- include "stdafx.h"
- include <iostream>
Prefer to post this code on forums.
'Hello World' links
- C
- C++
- C++ Builder, console
- C++ Builder, VCL
- C++ Builder, CLX
- C++ BuilderX, console
- C++ BuilderX, Win32 API
- C#
- PHP
- Prolog
- Turbo C++
- ?Turbo C++ 2005
- Visual C++ 2005
- Visual Prolog
- Win32 API
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
