lundi 6 avril 2015

How to initialize a c++11 native pointer and array in a class?

For example



class A
{
int *p{}; // is this fine without giving the null pointer value 0?
int p[3]{}; // is this fine without double braces {{ }}? std::array need.
};


My testing shows they pass intel c++ compiler. But not sure if they are standardly right or not?


Aucun commentaire:

Enregistrer un commentaire