1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | void f1(int a, int &b, char r) { int one; one=a; a++; b*=2; r='B'; cout<<a<<b<<r; cout<<one<<endL; } void f2( int &x, int y , char &w ) { x++; y=y*2; w='G'; cout<<x<<y<<w<<endL; } void main () { int n1=1 , n2=3; ch='A'; cout<<n1<<n2<<ch<<endL; f1(n1,n2,ch); cout<<n1<<n2<<ch<<endL; f2(n2,25,ch); cout<<n1<<n2<<ch<<endL; } |
dm9pZCBmMShpbnQgYSwgaW50ICZiLCBjaGFyIHIpCnsKaW50IG9uZTsKb25lPWE7CmErKzsKYio9MjsKcj0nQic7CmNvdXQ8PGE8PGI8PHI7CmNvdXQ8PG9uZTw8ZW5kTDsKfQp2b2lkIGYyKCBpbnQgJngsIGludCB5ICwgY2hhciAmdyApCnsKeCsrOwp5PXkqMjsKdz0nRyc7CmNvdXQ8PHg8PHk8PHc8PGVuZEw7Cn0Kdm9pZCBtYWluICgpCnsKaW50IG4xPTEgLCBuMj0zOwpjaD0nQSc7CmNvdXQ8PG4xPDxuMjw8Y2g8PGVuZEw7CmYxKG4xLG4yLGNoKTsKY291dDw8bjE8PG4yPDxjaDw8ZW5kTDsKZjIobjIsMjUsY2gpOwpjb3V0PDxuMTw8bjI8PGNoPDxlbmRMOwp9Cg==
prog.cpp: In function ‘void f1(int, int&, char)’: prog.cpp:8: error: ‘cout’ was not declared in this scope prog.cpp:9: error: ‘endL’ was not declared in this scope prog.cpp: In function ‘void f2(int&, int, char&)’: prog.cpp:16: error: ‘cout’ was not declared in this scope prog.cpp:16: error: ‘endL’ was not declared in this scope prog.cpp: At global scope: prog.cpp:18: error: ‘::main’ must return ‘int’ prog.cpp: In function ‘int main()’: prog.cpp:21: error: ‘ch’ was not declared in this scope prog.cpp:22: error: ‘cout’ was not declared in this scope prog.cpp:22: error: ‘endL’ was not declared in this scope
-
result: Compilation error (maybe you wish to see an example for C++ 4.7.2)


