Zitat:
|
Zitat von Live Hat nix mit Visual zu tun, der Code ist einfach falsch - muss so sein:
#include <iostream.h>
int x = 10, y = 15;
int a = x + y;
void main(void)
{
cout << "Ein kleines Rechenbeispiel:\n";
cout << x * y <<"\n";
cout << "Ergebniss:\n" << a;
} |
Dein Code is aber auch falsch :o.
Code:
#include <iostream> // ohne .h (Standardkonform)
using namespace std;
int x = 10, y = 15, a = x + y;
int main() // nicht 'void', sondern int (Standardkonform)
{
// Kein "\n", sonst wird der cout-Puffer nicht geleert
cout << "Ein kleines Rechenbeispiel: " << endl;
cout << x * y << endl;
cout << "Ergebnis: " << a << endl;
cin.get();
return 0;
}