fork(1) download
  1. class foo
  2. {
  3. private: // change to public and it will compile
  4. int i;
  5. float f;
  6. char c;
  7. };
  8.  
  9. int main()
  10. {
  11. foo f = {42, 3.14, 'a'};
  12. }
  13.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:11:25: error: could not convert ‘{42, 3.1400000000000001e+0, 'a'}’ from ‘<brace-enclosed initializer list>’ to ‘foo’
   foo f = {42, 3.14, 'a'};
                         ^
stdout
Standard output is empty