"cannot specify explicit initializer for arrays"
http://cboard.cprogramming.com/showt...threadid=38815
That topic is related, sort of... its the same class, but this is a different thing I'm trying to do.
I have code that technically would "work"...
The error is:
cannot specify explicit initializer for arrays
If the user tells it it is a char* instead of just a regular array, it will compile, only it isn't a character array anymore really... and I want the user to be able to choose between char[] and char*...
Code:
holder(const ValueType & value)
: held(value)
{//non array (or pointer)
}
That won't take a string... something like
Code:
char x[10] = "abcd";
holder y(x);
won't compile, while
Code:
char x[10] = "abcd";
holder y((char*)x);
or
Code:
char *x = "abcd";
holder y(x);
will.
My understanding of the problem is that the fact that it is declared as
ValueType held;
in the class, and it can't figure out how to make something like
"char[20] held;"