L
Lyle Avery
Hello guys,
Look at this in c++ file:
class T
{
public:
char c;
char ca[];
};
The size of this class sizeof(T) is 1, and this is error when assign a string to char[] e.g. T t; t.ca="Hello World!"; : error C2440: '=' : cannot convert from 'const char [13]' to 'char []'
Who can tell me why... why not???
If i want to assign a string to member array in struct/union, how to do it?
Help me, thanks.
Look at this in c++ file:
class T
{
public:
char c;
char ca[];
};
The size of this class sizeof(T) is 1, and this is error when assign a string to char[] e.g. T t; t.ca="Hello World!"; : error C2440: '=' : cannot convert from 'const char [13]' to 'char []'
Who can tell me why... why not???
If i want to assign a string to member array in struct/union, how to do it?
Help me, thanks.