1.You don't download C++; you download a
C++ compiler. This takes your source code and builds it, then links it into an executable. If you're running windows
or Linux; I would strongly recommend you use Code::Blocks
http://www.codeblocks.org/ it's a very easy to use IDE (integrated development environment; essentially a text editor with some buttons you can press to automagically compile your code). A common compiler is gcc or g++; they both come with Codeblocks I believe. If you use Linux you will have to build it from source (unless you use Debian, Ubuntu or Linux Mint, then you just have to open a terminal and type "sudo apt-get install codeblocks"). Building programs from source code is usually fairly easy (although people seem to think it's hard, but it just takes longer). To build from source, download the source code (here:
http://www.codeblocks.org/downloads/6 ) to a directory, e.g. /home/username/Downloads and then open a terminal
cd to the location (e.g.
cd ~/Downloads/codeblocks_xxXX
and type
./configure. When that command completes type
make and then when
that completes type
sudo make install
.
2. A good program to start with would be the typical "hello, world" program:
1 2 3 4 5 6
|
#include <iostream>
int main() {
std::cout << "Hello, world\n";
return 0;
}
|
I'd recommend you follow a tutorial;
http://cplusplus.com/doc/tutorial/ is very good.
When you've read through that, see
http://cplusplus.com/forum/articles/12974/ for some more ideas.