vc++2010 How to create a new project and print HelloWorld in the console

Source: Internet
Author: User

The problem with writing about what integrated development environment is used in C + + is actually quite tangled. I have been looking for a long time to find codeblocks, and found that the IDE is best used in the most standard C + + syntax environment. In fact, previously installed vs2015 flagship version, but this software is too large, very consumption of resources. Later still downloaded the VS2010 CD-ROM file, fortunately, VC + + can be installed separately, this software is very small, I want to learn is enough. Here's how to print Helloword in a DOS console using C + +

#include <iostream>usingnamespace  std; int Main () {    "hello world!\n";     return 0 ;}

In fact, the code is very simple, simple explanation: The first line is the introduction of output support. The second line emphasizes the use of a namespace, which is something that must be done. Then there is the output function of the cout,c++ language. The problem with writing this code is to be emphasized here.

First of all, to introduce output input support, this is a must

Second, there must be namespace, otherwise it does not know the cout function

Again, set-compile-non-debug Run button

Right-click Toolbar blank-Customize-commands-toolbars-build-add command-debug-Start Execution (not debug)-ok-close. Then again right click on the toolbar blank, choose "Generate", so compile, non-debug run out!

Finally, set the IDE, right-click on your project-Properties-Configuration Properties-linker-system-subsystem, drop-down list select Console (/subsystem:console). This ensures that the DOS console will not flash when printed.

vc++2010 How to create a new project and print HelloWorld in the console

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.