fork(1) download
  1. Int i = 1;
  2.  
  3. Void f(int* pi)
  4. {
  5. Int i= 42;
  6. *pi =0;
  7. Cout<< "f- der wert von i ist:"<< i<<endl;
  8. /*wieso wird hier die 42 ausgegeben und nicht die 0? *pi zeigt doch zur adresse von i?
  9. */
  10. }
  11.  
  12. Void g( int i)
  13. {
  14. Cout<< "g- der wert von i ist:"<< i<< endl;
  15. }
  16.  
  17. Int main()
  18. {
  19. Cout<<" main- der wert von i ist:"<< i<< endl;
  20. g(4711);
  21. f(&i);
  22. Cout<< "main- der wert von i ist:"<<i<<endl;
  23. //wieso wird hier die 0 ausgegeben?
  24. Return 0;
  25. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:1:1: error: 'Int' does not name a type
 Int i = 1;
 ^
prog.cpp:3:1: error: 'Void' does not name a type
 Void f(int* pi)
 ^
prog.cpp:12:1: error: 'Void' does not name a type
 Void g( int i)
 ^
prog.cpp:17:1: error: 'Int' does not name a type
 Int main()
 ^
stdout
Standard output is empty