Tuesday, 24 May 2016

Can we declare a array with empty size is class or struct?

 
Is below program will compile?

#include<iostream>

class test
{
   public:
   int a[];
   char b[];
};

int main()
{
   test t1;
   return 0;
}


OUTPUT: No compilation error. Array with empty size is allowable syntax in c and c++.