Warum erst Funktionsaufruf und dann Ausgabe ? cout<<" 32 * 5 = "<<multiply(32,5);
-
Die Ausgabe bei folgendem Beispiel lautet:
`Ergebnis: 32 * 5 = 160`
Warum wird hier erst die Funktion abgearbeitet und dann erst
die cout Ausgabe vom Hauptprogramm? Geht der Compiler von rechts nach links ??#include<iostream> using namespace std; int multiply(int a, int b) { cout<<" Ergebnis : "; return a*b; } int main() { cout<<" 32 * 5 = "<<multiply(32,5)<<endl; getchar(); }
-
Du solltest die Frage nochmal im C++-Forum stellen.
-
Danke - hab sie 'drüben' auch reingestellt.
-
Hallo,
siehe:
http://www.c-plusplus.net/forum/viewtopic-var-p-is-1812166.html#1812166
MfG,
Probe-Nutzer