mardi 21 avril 2015

Constructor Initialization Lists for Multidimensional array

I tried to initialize all data in the member array to 0

class Array {
    int m_anArray1D[10];
    int m_anArray2D[10][10];
public:
    Array(): m_anArray1D{0}, m_anArray2D{{0}} {}
};

but the codes will never be working.

Is there anyway to assign all data inside a 2D array at once?

Aucun commentaire:

Enregistrer un commentaire