How to create Initialized and non initialized arrays in C++ ?

Sometimes we need to declare both initialized and  non initialized arrays. For Example:

class test {

int a;


test() { a=0; }

test(int b) { a=b; }

int get_a() { return a; }


For this class we can have:

Initialized array:

test i[2] = {7, 1,};

Non initialized array:

test j[12];

Leave a Reply