E
Du meine Güte! Man weiß gar nicht, wie man anfangen soll.
Also zunächst empfehle ich Dir, MS VC++ mal bei Seite zu lassen.
Besorge Dir die IDE Dev-C++. Die gibt es hier:
http://www.bloodshed.net/dev/devcpp.html (Version 4.980)
http://prdownloads.sourceforge.net/dev-cpp/devcpp4980.exe (Download)
http://bloodshed.net/dev/devcpp4982.exe (Update auf Version 4.982)
Da ist das Anfangen viel einfacher. Man öffnet eine neue leere Datei, gibt den gewünschten Sourcecode ein, speichert als xxx.cpp und kompiliert. Basta. Ideal für Einsteiger und folgt dem aktuellen C++-Standard von 1998.
MSVC++ ist da eine ganze Ecke komplizierter wegen des Arbeitsbereich-/Projektzwangs, aber ein gutes Werkzeug für die Windows-Programmierung mit WinAPI oder MFC.
Hier ein C++-Einsteigerprogramm:
// http://99-bottles-of-beer.ls-la.net/c.html#C++-(hacking-style)
//
// C++ version of 99 Bottles of beer
// programmer: Tim Robinson timtroyr@ionet.net
// Corrections by Johannes Tevessen
// modified by Dr. Erhard Henkes
//
#include <iostream> // fuer cout und endl
#include <conio.h>
#include <windows.h>
using namespace std;
int main()
{
int bottles = 99;
while ( bottles > 0 )
{
cout << bottles << " bottle(s) of beer on the wall," << endl;
cout << bottles << " bottle(s) of beer." << endl;
cout << "Take one down, pass it around," << endl;
cout << --bottles << " bottle(s) of beer on the wall." << endl;
Sleep(50); // windows.h
}
getch(); // conio.h
}
Das return 0 kannst Du Dir schenken. Moderne Compiler machen das automatisch am Ende. main() gibt int zurück und nicht void. getch() aus conio.h gehört nicht zum C++-Standard, ist aber ungemein praktisch.