I have problem initializing array in C++14.
int *arr={1,2,3,4}; // Works in C but does not work in C++
I can't understand the error message it shows
prog.cpp: In function 'int main()':
prog.cpp:6:26: error: scalar object 'arr' requires one element in initializer
int *arr = {1, 22, 5, 20}; //NOT WORKING IN C++
What is the exact meaning of initializer in the error message?
Link of code of C++ which is not working http://ideone.com/684V5t
Link of Same code in C which works http://ideone.com/RAL3te
If anyone can explain why this is happening it would be nice. Thank you.