Navigation



0.6 — Compiling your first program

Before we can write our first program (which we will do very soon), we need to know two things about development environments.

First, although our programs will be written inside .cpp files, the .cpp files themselves will be added to a project. Some IDEs call projects “workspaces”, or “solutions”. The project stores the names of all the code files we want to compile, and also saves various IDE settings. Every time we reopen the project, it will restore the state of the IDE to where we left off. When we choose to compile our program, the project tells the compiler and linker which files to compile and link. It is worth noting that project files for one IDE will not work in another IDE.

Second, there are different kinds of projects. When you create a new project, you will have to pick a project type. All of the projects that we will create in this tutorial will be console projects. A console project means that we are going to create programs that can be run from the dos or linux command-line. By default, console applications have no graphical user interface (GUI) and are compiled into stand-alone executable files. This is perfect for learning C++, because it keeps the complexity to a minimum.

Traditionally, the first program programmers write in a new language is the infamous hello world program, and we aren’t going to deprive you of that experience! You’ll thank us later. Maybe.

A quick note about examples containing code

Starting with this lesson, you will see many examples of C++ code presented. Most of these examples will look something like this:

#include <iostream>

int main()
{
	using namespace std;
	cout << "Hello world!" << endl;
	return 0;
}

If you select the code from these examples with your mouse and then copy/past it into your compiler, you will also get the line numbers, which you will have to strip out manually. Instead, click the “copy to clipboard” link at the top of the example. This will copy the code to your clipboard without the line numbers, which you can then paste into your compiler without any editing required.

Visual Studio 2005 Express

To create a new project in Visual Studio 2005 Express, go to the File menu, and select New -> Project. A dialog box will pop up that looks like this:

VC2005 Project Dialog

Select the Win32 project type, and Win32 Console Application will automatically be selected for you. In the Name field, you will enter the name of your program. Type in HelloWorld. In the Location field, pick a directory that you would like your project to be placed into. We recommend you place them in a subdirectory off of your C drive, such as C:\VC2005Projects. Click OK, and then Finish.

On the left side, in the Solution Explorer, Visual Studio has created a number of files for you, including stdafx.h, HelloWorld.cpp, and stdafx.cpp.

Initial Visual C++ program

In the text editor, you will see that VC2005 has already created some code for you. Select and delete the _tmain function, and then type/copy the following into your compiler:

#include "stdafx.h"
#include <iostream>

int main()
{
	std::cout << "Hello world!" << std::endl;
	return 0;
}

What you end up with should look like this:

Visual C++ hello world program

To compile your program, either press F7 or go to the Build menu and choose “Build Solution”. If all goes well, you should see the following appear in the Output window:

Successful build

This means your compile was successful!

To run your compiled program, press ctrl-F5, or go the Debug menu and choose “Start Without Debugging”. You will see the following:

Program run

That is the result of your program!

Important note to Visual Studio users: Visual studio programs should ALWAYS begin with the following line:

#include "stdafx.h"

Otherwise you will receive a compiler warning, such as c:\test\test.cpp(21) : fatal error C1010: unexpected end of file while looking for precompiled header directive

Alternately, you can turn off precompiled headers. However, using precompiled headers will make your program compile much faster, so we recommend leaving them on unless you are developing a cross-platform program.

The example programs we show you throughout the tutorial will not include this line, because it is specific to your compiler.

Code::Blocks

To create a new project in Code::Blocks, go to the File menu, and select New Project. A dialog box will pop up that looks like this:

Code::Blocks Project Dialog

Select Console Application and press the Create button.

You will be asked to save your project. You can save it wherever you wish, though we recommend you save it in a subdirectory off of the C drive, such as C:\CBProjects. Name the project HelloWorld.

Code::Blocks Save Project Dialog

You will see “Console Application” under the default workspace:

Code::Blocks Project Closed

Open the tree under “Console Application”, open “Sources”, and double click on “main.cpp”. You will see that the hello world program has already been written for you!

To build your project, press ctrl-F9, or go to the Build menu and choose “Build”. If all goes well, you should see the following appear in the Build log window:

Successful build

This means your compile was successful!

To run your compiled program, press ctrl-F10, or go the Build menu and choose “Run”. You will see something similar to the following:

Program run

That is the result of your program!

Using a command-line based compiler

Paste the following into a text file named HelloWorld.cpp:

#include <iostream>

int main()
{
	using namespace std;
	cout << "Hello world!" << endl;
	return 0;
}

From the command line, type:

g++ -o HelloWorld HelloWorld.cpp

This will compile and link HelloWorld.cpp. To run it, type:

HelloWorld (or possibly .\HelloWorld), and you will see the output of your program.

Other IDEs

You will have to figure out how to do the following on your own:
1) Create a console project
2) Add a .cpp file to the project (if necessary)
3) Paste the following code into the file:

#include <iostream>

int main()
{
	using namespace std;
	cout << "Hello world!" << endl;
	return 0;
}

4) Compile the project
5) Run the project

If compiling fails

If compiling the above program fails, check to ensure that you’ve typed or pasted the code in correctly. The compiler’s error message may give you a clue as to where or what the problem is.

If you are using a much older C++ compiler, the compiler may give an error about not understanding how to include iostream. If this is the case, try the following program instead:

#include <iostream.h>

int main()
{
	cout << "Hello world!" << endl;
	return 0;
}

In this case, you should upgrade your compiler to something more compliant with recent standards.

If your program runs but the window closes immediately

This is an issue with some compilers, such as Bloodshed’s Dev-C++. We present a solution to this problem in lesson 0.7 — a few common cpp problems.

Conclusion

Congratulations, you made it through the hardest part of this tutorial (installing the IDE and compiling your first program)! You are now ready to learn C++!

0.7 — A few common C++ problems
Index
0.5 — Installing an Integrated Development Environment (IDE)


Are you looking to earn an online programming degree? If you want to get a degree in education sign online today. By getting an online degree you are learning on your own time; online educations can fit right into your schedule. You won't have to worry about making it to class on time. Getting your education online is the education of the future!

239 comments to 0.6 — Compiling your first program

  • chris
    i have visual c++ express 2008 when i named the file hello world it already had some code for me
    Console::WriteLine(L"Hello World"); instead of cout << "Hello world!" << endl; and when i try using cout << "blah" << end1; it comes up as an error does that mean i can't learn from this site since my software won't recognize it as code
  • Ian

    I DID IT!!! I am soooo excited. Just want to say THANK YOU, for helping me create my very first program. I am ready to get through all these tutorials and Learn, Learn, Learn. I may dream in C++ tonight.

  • Ryker

    Hello, I believe I typed in exactly what was shown but I’m still coming up with errors. I’m currently using Microsoft Visual Studio Ultimate 2010.

    Error List

    Error 1 error C2065: ‘cin’ : undeclared identifier
    Error 2 error C2228: left of ‘.clear’ must have class/struct/union
    Error 3 error C2065: ‘cin’ : undeclared identifier
    Error 4 error C2228: left of ‘.ignore’ must have class/struct/union
    Error 5 error C2065: ‘cin’ : undeclared identifier
    Error 6 error C2228: left of ‘.get’ must have class/struct/undefined
    7 IntelliSense: identifier “cin” is undefined

    #include <iostream>
    
    int main()
    {
    	std::cout << "Hello World" << std::endl;
    	cin.clear();
    	cin.ignore(255, '\n');
    	cin,get();
    	return 0;
    }
    
    • Pakoschild

      you should type

      #include “stdafx.h”

      #include

      int main()
      {
      std::cout << "Hello world!" << std::endl;
      return 0;
      }

      its really easy but so cool try copy this to your clipboard but first delete everything except the green letters ;)hope I helped :D

  • Ryker

    Actually I see that I did not add.

    using namespace std;
    

    -_-

    Thanks,

    Ryker

  • Ryker

    Hello, I’m having a little problem it says that I need to create a new project in Code::Blocks. But I cannot seem to find where to do that in Visual Studio Ultimate 2010. I also tried searching google and the help Index unfortunately no luck there. If anyone has any suggestion or answers that would be phenomenal!

    Thanks,

    Ryker

  • wasim

    PLZZ HELP ME WHEN I WANT TO RUN PROGRAM THIS ERROR APPEAR

    HelloWorld.exe-Unable To Locate Component
    This application has failed to start because MSVCR90D.dll was not found.Re-installing the application may fix the problem.

  • Lavinia

    I followed all the steps you did, but always when I build appears:

    ————– Build: Debug in Inceput —————

    Compiling: main.cpp
    Execution of ‘mingw32-g++.exe -Wall -fexceptions -g -c “D:X AInceputmain.cpp” -o objDebugmain.o’ in ‘D:X AInceput’ failed.
    Nothing to be done.

    Please help me

  • [...] Installing an Integrated Development Environment (IDE): the screenshots are for Visual C++ 2005 so you have to slightly adapt. You learn how to compile your 1st program. [...]

  • alefrost

    I downloaded the Eclipse program for C/C++. When I type in the code, it says that there is: “Unresolved inclusion: “, in addition to the squiggly line saying something is wrong. I don’t know why it’s doing that because I’ve copy pasted from this page and I’ve even watched tutorials and copied exactly what they did.

    in the console tab it prints:
    (Cannot run program “make”: Unknown reason)

    Help would be appreciated, thanks.

  • izzy181

    I have a newb question. Can an .exe file created using Dev C++ be executed on a Mac? And vice versa, can a file created with a Mac IDE be run on a Windows machine?
    Thanks!

    • e-joey

      The first I am not sure, it looks like no-one has been posting for a while so you migt want to ask at “the code project” or somewhere like that. The second I do know, if the file extension is a mac only file extension (g he said) no, but again I am too new to take my word, code project or cpp.com.
      I am going to be here for a while, nice talking.

  • e-joey

    How do you save a VB program to your flash drive?

    I am using 2008 and it worked perfect, I am doing these in Bloodshed ++, VB2008 and maybe 2010 if I can get it.

  • IndyBob

    Hello,
    do I have to create a new project for every little program that I write or is there a way to have them all in one project? Each project eats sth like 10 MB of disc space.
    Thanks,
    Matej

  • cmag79

    Sorry…stupid question here. I don’t have the Start without Debug option. I’m using MS Visual Studio C++ 2010 Express.

    menu-Debug
    -Start Debugging
    -Build Solution
    -Step into
    -Step over
    -Toggle Breakpoint
    -Windows
    -Clear all data tips (inactive)
    -Export data tips (inactive)
    -Import data tips
    -Options and Settings

  • bailey53189

    Wow i can actually do this!!!! Thank you so much cant wait to work my way through the rest of your site! I downloaded VS2010 and Code Blocks have to say i like code blocks better because it has the numbered lines great website really made me believe that i can actually do this!!!

  • Vox520

    I type in everything fine yet when it comes to end1; it repeatedly says there is an error.
    Saying this though when I paste the line of text in from the example it works.
    Anyone know of a solution to this problem?

  • May

    Hi, I use Windows 7 on Parallels through my Mac.
    Since I am also using Visual C++ 2010, I don’t have the “Start without Debugging” option, so when running, I was getting the error:

    ‘Helloworld.exe’: Loaded ‘C:\Users\Administrator\Documents\C++ Tutorial\Helloworld\Release\Helloworld.exe’, Symbols loaded.
    ‘Helloworld.exe’: Loaded ‘C:\Windows\System32\ntdll.dll’, Cannot find or open the PDB file
    ‘Helloworld.exe’: Loaded ‘C:\Windows\System32\kernel32.dll’, Cannot find or open the PDB file
    ‘Helloworld.exe’: Loaded ‘C:\Windows\System32\KernelBase.dll’, Cannot find or open the PDB file
    ‘Helloworld.exe’: Loaded ‘C:\Windows\System32\msvcp100.dll’, Symbols loaded.
    ‘Helloworld.exe’: Loaded ‘C:\Windows\System32\msvcr100.dll’, Symbols loaded.
    The program ‘[984] Helloworld.exe: Native’ has exited with code 0 (0×0).

    Also, the command window quickly opened and immediately closed.

    I fixed this by adding the Control+F5 option in Parallels…
    See Menu Parallels Desktop -> Preferences -> Keyboard
    I chose Cmnd+Ctrl+F5 to translate to Ctrl+F5

    This allowed me to Start without Debugging and therefore, solved my problem.

    …In case someone runs into the same problem…

    • madhavdivya

      @May,

      I do not have parallels (by parallels, I assume that you have Win7 on your Mac)on my system, just Win7 and Visual C++2010, yet I get the same error.

      Can you point me in the right direction ?

      thanks,

  • staryash

    here is download link for visual c++ 2005 express edition “http://www.softpedia.com/dyn-postdownload.php?p=11595&t=0&i=1″

  • staryash

    here is download link for visual c++ 2005 express edition "http://www.softpedia.com/dyn-postdownload.php?p=11595&t=0&i=1"

  • a8cplusplus

    I compiled my first program successfully. Thanks to learncpp.com

  • YEA! YES! WOOOOOHOOOO!!!!
    MY FIRST PROGRAM!
    thank you learncp.com!

  • mpho

    Hi,i want to do my project here so it is not compiling.im using bloodsh#include

    using namespace std;

    int main()

    {char firstletter;
    int wardnumber1,wardnumber2,wardnumber3,wardnumber4;
    cout<>firstletter;
    if(firstletter=A){
    cout<<"ward4";}
    else{
    if(firstletter=B){
    cout<<"ward3";}
    else{
    if(firstletter=C){
    cout<<"ward2";}
    else{
    if(firstletter=D){
    cout<<"ward1";}
    }
    }
    }
    }
    system("PAUSE");
    return EXIT_SUCCESS;
    }
    ed cpp. please help me.

  • mpho

    when im compiling,it makes an erro saying like
    Permission denied
    ld returned 1 exit status
    C:\Dev-Cpp\Makefile.win [Build Error] ["tax] Error 1

    please help me out

    • I’ll be replying to both comments –
      1) First of all you don’t write else{if{code}};, you write it like else if ( == 1 ){code;} (Way cleaner too).
      Second of all you should be using quotation marks, because in this case you’re asking the compiler to check if firstletter is equal to a, which isn’t initalized.
      Also you need to use two equation signs when checking equality.
      Third – you never tell what kind of values wardnumbers are actually containing, which results in a warning.
      Fourth – never use system(“PAUSE”) – It’s rather slow, sucky and it has sucky compatibility when compared to alternatives.
      fifth – try returning actual value, instead of exit_success or whatever.
      So yeah – your code is faulty, and requires a rewrite.
      2) Make sure you have permission to the folder you’re trying to save to. It might be possible that your HDD is locking up a bit, in which case you need to wait a few minutes before trying to compile it again. Without additional information it’s kind of impossible to solve this problem.

  • Helleri

    I started off Learning C (before a friend told me I should probably start with C++ and work back for more ease of learning)…So I had learned about much of what has been said in these tutorials up to this point. I am finding two things to be different and was wondering about them. I don’t see numbered lines in my compiler, is the first thing (using Microsoft Visual c++ 2010 Express). Secondly what is called the typical ‘Hello world!’ program…well I remember in starting to learn C, that when I got to that part, It showed me how to type in what I wanted a sort of correct entry to be to return a result of Hello world and make it so that any thing else would return a goodbye world…and how to make it so the return key being hit once again is what would actually close the program… I can see this one does not give me an else type of function. And it doesn’t seem to prevent the program form automatically closing until I tell it to with the return key. But, what surprised me is that I get no ‘Hello World’ even. The picture it shows is literally what it does before snapping closed.

    I also felt it was very monkey see monkey do…It didn’t really explain to me what was happening to make these things happen. If that is in a later lesson then good…but I really felt this lesson was the place for a little explanation on what is actually going on…it has been a little while since I first started learning C and so I can say I feel left lost on what I actually did and the how’s and why’s of it.

    Okay one last thing…It is a little annoying to have to scan over instructions for people using an ‘other then top recommended’ compiler. maybe at the top of these tutorials there could be a frame or something with options for viewing how things are done in different programs… that targets the rest of the page with the users selection? I mean just so people using one program don’t have to see the instructions for all the other programs they could be using before getting back to it…If that were the case there might be room to get a little more explanatory relevant to what I have going on in front of me.

  • HORUS793

    Hi, is there any problem if I use the getch() method from ?

  • HORUS793

    Hi, is there any problem if I use the getch() method from ?
    Thanks in advance!

  • XxSCNxX

    awesome the int main() is the same on java, too bad i only know about the variables D:

  • MrA

    Hello. I’m struggling already! TOTALLY new to any form of programming what so ever so please excuse the basic question…
    I’m working on a Mac using Xcode 3.2.6 for Mac OS X 10.6 and iOS 4.3. When I attempt to open a new project I see nothing like a ‘console’ option (the very first point!). Instead I have options for ‘Navigation-based Application’, OpenGL ES Application’, ‘Split View-based Application’, etc…

    Am I using the correct Xcode (are there others?), and do you have any pointers that may help? (background reading, go out and buy a PC, anything really…)

    Thanks
    Mr A

  • Tom

    I am using the code blocks IDE software and when I go to create a project it takes me to this setup wizard which titled
    “console application” which I had previously selected. It then gives me the option of creating a debug configuration (with more advanced options presented underneath) or creating a release configuration (“”) but I do not understand whether to leave all the tick boxes at default (which i have already tried once after restarting the project and it then tells me under the Build log the following “”HelloWorld – Debug” uses an invalid compiler. Probably the toolchain path within the compiler options is not setup correctly?! Skipping…
    Nothing to be done.”
    Does anybody know which options to select?

  • cppraider

    in order to run HelloWorld.cpp the command would be ./HelloWorld
    here… its .\HelloWorld given… may b its just a mistake… plz make it correct… thanks a ton for these tutorials… they are really helpful… thanks a google….!!!

  • [...] not have known it, you’ve actually been using the STL since your very first program back in lesson 0.6, when you included iostream. iostream (and our friend cout) are part of the [...]

  • worldtraveller321

    Ok Now I got Xcode to work.

    I am not able to get the separate screen to work when i run a simple program.

    So here is my program just a Helloworld program

    Code:
    #include

    int main()

    {
    int mynumber;
    mynumber = 34
    cout << " my number is ";
    cout << "Hello world!" << endl;
    cout << mynumber;
    system("pause");
    return 0;

    }

    So when i run it in Xcode, it works. it says Run Succeeded
    however i am supposed to get a second pop screen like a command prompt, like same when i run program on my Windows computer
    that has "hello world" and 34 etc.

    What function on Xcode do i use to make this happen?
    thanks

  • worldtraveller321

    Ok Now I got Xcode to work.

    So you all know I use Apple Computer
    a IMac desktop

    I am not able to get the separate screen to work when i run a simple program.

    So here is my program just a Helloworld program

    Code:
    #include

    int main()

    {
    int mynumber;
    mynumber = 34
    cout << " my number is ";
    cout << "Hello world!" << endl;
    cout << mynumber;
    system("pause");
    return 0;

    }

    So when i run it in Xcode, it works. it says Run Succeeded
    however i am supposed to get a second pop screen like a command prompt, like same when i run program on my Windows computer
    that has "hello world" and 34 etc.

    What function on Xcode do i use to make this happen?
    thanks

  • [...] I had several errors in my code to fix before my application would run. That’s pretty sad but at least I can admit it. I am not a fan of the :: syntax or the need for semicolons to end the line. Also, the main routine line seems a bit “syntaxy”. It wasn’t my first c++ program but I still needed this cheat sheet: http://www.learncpp.com/cpp-tutorial/06-writing-your-first-program/ [...]

  • Runeony1

    Hey guys I am completely new to c++ as like some of you guys and I know for the Windpws 7 version of c++ 2010 express that it immediately closes after you hit start debugging. Well, put system(“pause”);
    right before the return 0; and it should work.

  • With a little effort, Hello World welcomed me into the world of Microsoft Visual C++ 2010 Express.

    In the early 1990s, I acquired numerous programming books and Borland’s 4.52 C++ compiler designed for Windows 95. While I dabbled some, my work fell to the wayside.

    Having viewed your website and with the successful download / install of MS Visual C++ 2010 Express, (mid-January 2012), let’s see how well I do. When I tried EXE files from my 1990′s compiler on Windows 7 operating system, they didn’t work. I’m hoping to resolve that problem with Microsoft’s newer compiler. I’ll be working on your tutorial using Windows XP Pro. However, I have a laptop with Windows 7 which I can test the programs on.

    Wish me luck! (or skill, depending upon your point of view.)

  • Twixxi

    Hi, just a quick note on microsoft visual express 2010, it no longer displays the “Press any key to continue…” by default when compiling a program, is there any work around for this?

    Just starting to learn so its probably something i cant figure out by myself until much later on, Thanks!

  • Twixxi

    Google has come to the rescue, for anyone else experiencing this problem you can add #include “stdlib.h” below your normal includes then add system(“pause”); to the end of your script(or where ever else you need to pause the program)

    *edit* And if i acctually read comments i wouldnt of needed to post this, D’oh!

  • Thank you very much now I understand something about C++ but tell me where i can get the box you use and where to start first something misunderstand so please i need your help

    ifrah

  • studentc

    I have microsoft 2010 express. i typed it exact but get errors. Two of them. That i have to put a ; before the return and something a new line. Any help would be great.

  • Son_Of_Diablo

    Okay I can’t get this to work :(

    I use Microsoft Visual C++ 2010

    my code is:

    // HelloWorld2.cpp : Defines the entry point for the console application.
    //

    #include “stdafx.h”

    #include

    int main()
    {
    std::cout << "hello World!" << std::endl;
    return 0;
    }

    and it says that this is wrong:
    #include
    Cannot open source file “iostream”
    and
    std::cout << "hello World!" <—— Build started: Project: HelloWorld2, Configuration: Debug Win32 ——
    1> stdafx.cpp
    1>c:\documents and settings\administrator\dokumenter\visual studio 2010\projects\helloworld2\helloworld2\stdafx.h(10): fatal error C1083: Cannot open include file: ‘stdio.h’: No such file or directory
    1> HelloWorld2.cpp
    1>c:\documents and settings\administrator\dokumenter\visual studio 2010\projects\helloworld2\helloworld2\stdafx.h(10): fatal error C1083: Cannot open include file: ‘stdio.h’: No such file or directory
    1> Generating Code…
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

    can someone please tell me what I have done wrong?

    Thanks!

  • hamid32264

    Hello

    I want to write the following program as my first program..but I receive
    fatal error C1190: managed targeted code requires a ‘/clr’ option
    *********************************************************
    I use Visual Studio 2010
    *****************************************************

    // 23.cpp : Defines the entry point for the console application.
    //

    # using

    using namespace System;

    int _main()
    {
    Console::WriteLine( S”Welcome to Visual C++ .NET!” );

    return 0;
    }

  • hamid32264

    #include “stdafx.h”
    # using

    using namespace System;

  • hamid32264

    # using

    # using

  • aarish

    i get an error

    “hellow world – Debug” uses an invalid compiler. Probably the toolchain path within the compiler options is not setup correctly?! Skipping…
    Nothing to be done.

  • Bilal

    i am having trouble compiling my first program. it gives the following error:

    1>—— Build started: Project: Hello World, Configuration: Debug Win32 ——
    1>MSVCRTD.lib(crtexew.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup
    1>C:\VC\Hello World\Debug\Hello World.exe : fatal error LNK1120: 1 unresolved externals
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

    PLEASE HELP ME OUT ANY1!!

  • negativezero

    Here is my code.

    #include “stdafx.h”
    #include

    int main()
    {
    std::cout << "Hello World" <—— Build started: Project: 1, Configuration: Debug Win32 ——
    1>LINK : error LNK2001: unresolved external symbol _mainCRTStartup
    1>c:\documents and settings\nicholas\my documents\visual studio 2010\Projects\1\Debug\1.exe : fatal error LNK1120: 1 unresolved externals
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

    • negativezero

      Sorry THIS is my code.

      #include “stdafx.h”
      #include

      int main()
      {
      std::cout << "Hello World" << std::endl;
      return 0;
      }

      • negativezero

        and this is my error.

        1>—— Build started: Project: 1, Configuration: Debug Win32 ——
        1>LINK : error LNK2001: unresolved external symbol _mainCRTStartup
        1>c:\documents and settings\nicholas\my documents\visual studio 2010\Projects\1\Debug\1.exe : fatal error LNK1120: 1 unresolved externals
        ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

  • ZycroNeXuS

    Failed to convert to COFF?

    // HelloWorld.cpp : Defines the entry point for the console application.
    //

    #include “stdafx.h”
    #include

    int main()
    {
    std::cout << "Hello world!" << std::endl;
    return 0;
    }

  • Raman

    I am new to c++ and using Devc++.Please give me more example.

You must be logged in to post a comment.