class foo{private: // change to public and it will compile int i; float f; char c;}; int main(){ foo f = {42, 3.14, 'a'};}
Standard input is empty
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'}; ^
Standard output is empty
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!