Beginner C++ Help

Completely New to C++

Sorry if this is the wrong place for this but I'm completely new to C++. I've installed NetBeans 8.2 on my Windows laptop and was told I need a compiler, is this right?

So where do I go from here. How do I get started?

Is Visual C a better road to go down?

I can't seem to find any videos on You Tube for NetBeans 8.2 using C++.

I just want to get to the part where I can write some code and learn what I'm doing and advance.

Thanks!






Last edited on
Download Visual Studio Community 2017.
Then you don't have to worry about all the nitty gritty under the hood stuff right now,
and can just start coding.
Learn that stuff later when you get a better grasp on programming fundamentals.
Last edited on
The Integrated Development Environment (IDE) you choose is not all that important right now so long it builds and runs your programs. NetBeans 8.2 is an IDE, so you're all set. If YouTube tutorials is your source, then you can watch almost any C++ video tutorial regardless of what compiler they are using. So long your compiler is a C/C++ one, you should be able to follow along just fine.
It was just knowing the exact steps to take to get to the part where I can actually type code.

I have set up an account on the Microsoft Visual Studio 2017.

I'm just about to head to the library to get out some books on it. Any recommendations?
> I'm just about to head to the library to get out some books on it. Any recommendations?

https://stackoverflow.com/questions/388242/the-definitive-c-book-guide-and-list
> I'm just about to head to the library to get out some books on [Visual Studio]

This shouldn't be necessary...

> I'm just about to head to the library to get out some books on [C++]

@UK Marine's list is a good one.
To be able to program in C++ in Visual Studio 2017, do I need Visual Studio Code?
I've installed NetBeans 8.2 on my Windows laptop and was told I need a compiler, is this right?

Netbeans is an IDE like Eclipse that doesn't come with a comiler so you would have to download one separately.
To be able to program in C++ in Visual Studio 2017, do I need Visual Studio Code?

Visual Studio Code is an editor and has nothing to do with Visual Studio.
Once you have downloaded and installed Visual Studio you don't need anything else. However make sure that you check C++ when you download it.

To get started
https://msdn.microsoft.com/en-us/library/jj620919.aspx
https://www.youtube.com/watch?v=rpJFtbP7KzA should work for VS 2017 as well
I still haven't got going with this. When I launch MS Visual Studio 2017 I am greeted with this page:-

https://developer.xamarin.com/guides/cross-platform/troubleshooting/questions/visualstudio-2017-rc/Images/reinstall4-orig.png

How do I know if I have C++ on it and what do I do next to get to the part where I can program in C++?

The links provided above and video's when I search on You Tube are bringing up something different than I see.
visual should contain c++. I think you can somewhere choose to only install some languages but the full install should have c++.

Should be new {project/solution/app/buzzwordoftheyear} on the menu followed by a choice of language (or if in the visual c++ only version, a choice of project types) followed by choice of project types (for student/beginner code you usually want a console program project).

You should be able to crank out hello world from there, to see if you can get it working.
Thanks jonnin but still not getting anywhere. A week and still haven't got to the part where I can write 1 single line of code yet lol! Searched all over the internet and You Tube and can't find anything on How to Program C++ in Microsoft Visual Studio 2017 that can guide me through it. Found one on Visual Studio 2015 on You Tube but because it was the wrong version it wasn't the same things he was clicking.

Back to what you said though, I didn't see New (anywhere on the page.) Just New Project.

I went File then I saw New, then there's Project or File, I clicked Project and all I have after that is Blank Solution. I clicked it but I couldn't type code anywhere. No app/buzzwordoftheyear. Not sure what I'm doing be honest as you can probably tell.
Last edited on
Run 'Microsoft Visual Studio Installer' and then choose: 'Desktop development with C++'

Follow the instructions on this page: https://www.visualstudio.com/vs/support/hello-world-c-using-visual-studio-2017/
Sorry for these (probably) lame questions but...does this mean I was supposed to install that on install and I need to uninstall Visual Studio 2017 and then select that when I reinstall it?

I tried reinstalling already without uninstalling it first but obviously it said I already have it installed and directed me to update.

To clarify, do I need to uninstall it to follow what you said or can I install Desktop development with C++ without doing that?
No, you do not need to uninstall Visual Studio 2017.

Run 'Microsoft Visual Studio Installer' (it will be there in the windows menu),

If 'Visual Studio Community 2017' is already installed, if there is an 'Update' button under it, click it.
It will update the already installed components; wait for this to finish.

Once the update is complete (or right in the beginning if no update is required), there would be a 'Modify' button, click it. You would then get the modify page (as shown in the image on https://www.visualstudio.com/vs/support/hello-world-c-using-visual-studio-2017/)

Choose: 'Desktop development with C++' and click 'Modify' on the bottom right corner.
Wait for the components to be installed.

To write your first program, continue with the instructions in the tutorial
https://www.visualstudio.com/vs/support/hello-world-c-using-visual-studio-2017/
Hey,

So I've typed the Hello World code from the link above into Visual Studio and clicked the green triangle to (presuming) compile and run the program but some box came up (which I forget now) that I clicked yes to and now when I click the green triangle, a blank window flashes up briefly and in the output window underneath, I get this:-

ConsoleApplication2.exe' (Win32): Loaded 'C:\Users\User\source\repos\ConsoleApplication2\Debug\ConsoleApplication2.exe'. Symbols loaded.
'ConsoleApplication2.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ntdll.dll'. Cannot find or open the PDB file.
'ConsoleApplication2.exe' (Win32): Loaded 'C:\Windows\SysWOW64\kernel32.dll'. Cannot find or open the PDB file.
'ConsoleApplication2.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\kernel32.dll'
'ConsoleApplication2.exe' (Win32): Loaded 'C:\Windows\SysWOW64\kernel32.dll'. Cannot find or open the PDB file.
'ConsoleApplication2.exe' (Win32): Loaded 'C:\Windows\SysWOW64\KernelBase.dll'. Cannot find or open the PDB file.
'ConsoleApplication2.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcp140d.dll'. Cannot find or open the PDB file.
'ConsoleApplication2.exe' (Win32): Loaded 'C:\Windows\SysWOW64\vcruntime140d.dll'. Cannot find or open the PDB file.
'ConsoleApplication2.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ucrtbased.dll'. Cannot find or open the PDB file.
'ConsoleApplication2.exe' (Win32): Loaded 'C:\Windows\SysWOW64\kernel.appcore.dll'. Cannot find or open the PDB file.
'ConsoleApplication2.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcrt.dll'. Cannot find or open the PDB file.
'ConsoleApplication2.exe' (Win32): Loaded 'C:\Windows\SysWOW64\rpcrt4.dll'. Cannot find or open the PDB file.
'ConsoleApplication2.exe' (Win32): Loaded 'C:\Windows\SysWOW64\sspicli.dll'. Cannot find or open the PDB file.
'ConsoleApplication2.exe' (Win32): Loaded 'C:\Windows\SysWOW64\cryptbase.dll'. Cannot find or open the PDB file.
'ConsoleApplication2.exe' (Win32): Loaded 'C:\Windows\SysWOW64\bcryptprimitives.dll'. Cannot find or open the PDB file.
'ConsoleApplication2.exe' (Win32): Loaded 'C:\Windows\SysWOW64\sechost.dll'. Cannot find or open the PDB file.
The thread 0x1d30 has exited with code 0 (0x0).
The thread 0x3228 has exited with code 0 (0x0).
The thread 0x2448 has exited with code 0 (0x0).
The program '[6064] ConsoleApplication2.exe' has exited with code 0 (0x0).

What's going on. The Hello World code is right I've double checked it?
> a blank window flashes up briefly

To make the window stay, add this line to your main()

1
2
3
4
5
6
7
8
9
10
11
12
#include "stdafx.h"
#include <iostream> 
using namespace std;    

int main()      
{    
    cout << "Hello World! ";    
    
    cin.get() ; // *** added: wait for the user to press the enter key

    return 0;      
}



> in the output window underneath, I get this:-

That is not the output window; those are debug messages in the debug window.
(The output window was the one that disappeared in a flash)
You may ignore these debug messages for now.

Alternatively, run the program without debugging (either press Ctrl+F5 or
from the menu, click Debug => Start Without Debugging) and the output window will stay till you press enter.

A third option is to place a breakpoint at the line return 0 ; as suggsted in step 8 of the tutorial.
Last edited on
Thanks JLBorges!
sometime its much better if u just use your Windows commands wich u can include into your application.

1
2
3
4
5
6
7
8
9
10
11
12
#include "stdafx.h"
#include <iostream> 
using namespace std;    

int main()      
{    
    cout << "Hello World! ";    
    
    system("pause") ; //the window will stay there till u click the X (close botton)

    return 0;      
}
@skifteri:

Using system("pause") is a bad idea, for reasons discussed here:

http://www.cplusplus.com/forum/beginner/1988/
Topic archived. No new replies allowed.