So I want to learn C++, I've found this nice looking learning guide on this site. At first I thought I'd use the Visual C++ Console Template since I know how to build and run programs in Visual Studio. That was a bad choice, as seen here
In the afore mentioned tutorial there's a 'Hello World' program to start out with...
1 2 3 4 5 6 7 8
|
// my first program in C++
#include <iostream>
using namespace std;
int main ()
{
cout << "Hello World!";
return 0;
}
|
Built into the Visual C++ Console Template is this 'Hello World' program...
1 2 3 4 5 6 7 8
|
// MyFirstC++.cpp : main project file.
#include "stdafx.h"
using namespace System;
int main(array<System::String ^> ^args)
{
Console::WriteLine(L"Hello World");
return 0;
}
|
If you ask me these look nothing alike. I'm sure an experienced C++/windows environment programmer would see little difference, but from my perspective half the code is different.
So I thought I'd try the free Borland C++ compiler. I have a directory now with a bunch of files including a Bin folder with a bunch of executable files. none of them look like anything that will help me. Again if I were an experienced C++ programmer I might know that this is just a compiler and not an IDE, well I think I do know that but I don't want to write a program in notepad, stick it in the directory and start running random .exe's.
So I decided to go with G++. I managed to find a guide to installing it in windows for console apps, but this appears to be a long and complicated process involving changing windows environment variables that may or may not be the same on windows 7 (it's for XP) and in the end you compile programs with a command like '
g++ -g hello.cpp -o hello -lm'.
I'm looking for a simple way to get to the point where I can type code from the tutorial into a text editor environment of some type and hit <build> (or something), and see "Hello World" in some sort of output. All without converting simple C++ code into system.net.windows.environment code.
I realize I might be asking for a little more then I'm gonna get, after all C++ is for serious programmers as I understand, but anything that beats the options I described should work.