New to C++ need help!

Ok, I want to learn C++. But my issue is ... where do I even type the code? What program do I use? Where can I download it? I hope this makes sense!
I recommend Visual C++ 2010. It's free, here are some steps for compiling your first program.

Steps:

1) Download and install Visual C++ 2010 blah blah blah all that.

2) Open it, under File create a New Project. Select Empty Project and below enter whatever name you like.

3) Then under project select Add New Item, add a .cpp source file and call it whatever you want.

4) Then in the actual field paste this:

1
2
3
4
5
6
#include<iostream>
using namespace std;

int main() {
	cout << "Wassup Nigga!";
	return 0;}


5) Then under Debug hit Start Debugging. If everything goes well you should see a brief flash of a black window.

CONGRATULATIONS!
Option 1) Go buy and linux magazine in a shop that has a CD / DVD of a linux distro on it. Learn using a text editor and g++ in a terminal, and move on to Makefiles. This is the best way as you get to focus on the programming and the compiler rather than having an IDE hide everything from you.

Option 2) (for wimps) Download Visual Studio Express for free from Microsoft's Website if you really insist on using windows.

Option 3) If you're on a Mac, install Xcode off the MacOS DVD
So i downloaded Visual C++ installed it... yet it is no where to be found on my computer. I am getting Frustrated because its just .. not there. If I go to uninstall a program on control panel its listed as a program. yet If i do a search for it on my computer, its not there. ANy idea?
Linux is free, why not just download it? moron

There is no "good" or "bad" OS, so calling people "wimps" based on personal preference...

Just because you have an IDE (Integrated Development Environment) doesn't mean you can't learn how the compiler works, you can always start to learn how to program with the IDE, then when you get a grasp, move on to the compiler through the command line. What's that? VC++ even has a command line version. [shocked face]Wow![/shocked face].

Throwing personal preference in as fact towards a newbie is completely asinine, the OP obviously has no idea wtf you're talking about, so you are doing anything but helping (being a j*ck*ss for example).

AsylumSaint, what do you wish to work under, a Unix based OS, Mac or Windows (I suggest sticking with whcihever you are running right now).

Under windows, I personally prefer Code::Blocks as a beginners tool (well, I used the old Borland C++ Compiler and Scintilla Text Editor as an almost IDE which is way outdated but still a handy tool for simple and beginner programs). Visual C++ is a higher end tool geared more towards graphic user intrefaces (GUIs) but still console capable.

For the best possible idea of what to get (compiler wise), I suggest reading this article:

http://cplusplus.com/articles/36vU7k9E/

After the author talks about why Dev-C++ (an old, out dated IDE) is old and out dated, he/ she moves into some really good advice as to what you can get.

For now I wish you the best of luck in your coding adventure and would advise that you steer clear of people who push one way or another (emyr666). There are some brilliant people on this site who will tell you to g with what you yourself prefer.
I have downloaded Code::blocks and I am currently on Windows Computer. I just want to get started is all. I tried to use Code:blocks but im not going to lie ... i am sort of confused after opening it ... it gives me WAY to many options of things.. and after I tried using default settings and Empty Template it gave me some errors (forget now) and I had no idea where to even start typing the code ...
It's not under your start menu anywhere? It should be under "Microsoft Visual Studio *edition*" (where edition should be "Exprees" or "Professional" or something of the sorts).

Where did you install it to? The default I got was under the C drive somewhere with the file title "MVS" (I installed it to my D drive, so I have no idea where the default is supposed to be).
Um to Danny .. it didnt give me any option of where to install it .... it just installed on its own. and no its not under my start menu. I'm rather computer fluent when it comes to just using one. and this program is definitely not there. I uninstalled and reinstalled it 3 times. All it does is ask if I accept the terms. a quick install. then nothing... it just says finish .. then closes.
What exactly did you download?
I probably got the wrong thing ... now that I think about it... but I googled and got this


http://www.microsoft.com/download/en/details.aspx?id=5555#instructions
I am fine now, I think I got it figured it out, nvm! and ty!
I'm googleing around right now.

Another thing worth mentioning, VC++ requires you to register it within 30 (I think 30) days. Regestration is free, but I thought I'd make sure you knew.
Okay, no problem. Glad you think you got it.
Ok so I got it working .. I copy and pasted the basic Source code. the "hello world" I started the debug, and the basic black screen pops up but so quick, I cant even see anything? Did I do something wrong?




#include<iostream>
using namespace std;

int main() {
cout << "Hello World";
return 0;}
Nope nope, that's the way it goes.
How Can I extend the time length o.O it disappears so quit I cant even see a single letter of what its supposed to show up.
Well I usually insert this in:

while (true) {};

It will end up keeping the window open. But someone will probably come in tell you a better way of doing it.
Yeah I just looked it up they used

system("Pause"); after the cout command.
http://cplusplus.com/forum/beginner/1988/

As you can tell, there are many various methods of keeping the console open, some better than others...
@creeklist

while(true){}
Run a program that has that code in it and check the CPU usage on your machine. Mine jumps from about 32% to 100% as soon as it runs... I would just add cin.get() as the last line of code to keep the console open.
Topic archived. No new replies allowed.