Sunday, 6 May 2018

TEST BLOG

 
<![if !supportLists]>1.    <![endif]>Whether data members of the class can be initialized at declaration time?
#include<iostream>

class ArrayNotFound
{
public:
       static const int val=10;
};

int main()
{
std::cout<<ArrayNotFound::val<<std::endl;
return 0;
}
10
Const static data members of the class can be initialized at the time of declaration. Other data members cannot be initialized during declaration of the class.