There is that way to set elements on array – int rgArrayNum [] = {16, 2, 77, 40, 12071};
How can I do same way on pointer with new ? I tried int *pArrayNum = new [] = {4 ,3 ,3} ; but it didn’t worked .
There is that way to set elements on array – int rgArrayNum [] =
Share
In c++11, you can write:
However, in c++03 array new initialization is not allowed; you’d have to initialize the members individually or by copy from an array on the stack: