Skip to main content
added 23 characters in body
Source Link
Benjamin Lindley
  • 104.2k
  • 11
  • 210
  • 285

I was about to initialize a char array inside a class as Class a{ char a[25]; }; a::a(){ a[] = {'a','b','c'}; }

class a{ char a[25]; }; a::a(){ a[] = {'a','b','c'}; } 

but gives compile time error.

I was about to initialize a char array inside a class as Class a{ char a[25]; }; a::a(){ a[] = {'a','b','c'}; }

but gives compile time error.

I was about to initialize a char array inside a class as

class a{ char a[25]; }; a::a(){ a[] = {'a','b','c'}; } 

but gives compile time error.

Source Link
Shashi Bhushan
  • 1.5k
  • 3
  • 17
  • 20

How to Initialize a char array inside a class?

I was about to initialize a char array inside a class as Class a{ char a[25]; }; a::a(){ a[] = {'a','b','c'}; }

but gives compile time error.