I'm trying to copy a cutomized valuetype to string type.
string source[10];
// bcString is a ValueType that hold a string object and implicit
// conversion from string type to bcString
bcString target[10];
target = source;
I have tryed with the syntax
target = (bcString[])(System.Array)source;
but I get an execution error (cannot convert...)
Any hints
Thanks,
Felice Russo

ValueType arrays
legoman26
jsin
RogerAu
JohnsonInBeijing
Have you tried using the Array.Copy method
Based on your example, you might find that Array.Copy(source, target, 10) give you what you need.
Hope it helps.
cell-gfx
Felice - like what others have suggested, you'll most likely have to do a item by item copy of the array. How is your type bcString defined Since you say it's a value type, is it a structure or enum You can neither derive from a specific value type nor from the ValueType class.
hope that helps,
Imran.
silvarea
Hi Bruce,
I have tried with Array.Copy but the MSDN Array.Copy documentation say:
An ArrayTypeMismatchException is thrown if the arrays are of incompatible types. Type compatibility is defined as follows:
...
- A nonintrinsic (user-defined) value type is compatible only with itself.
In fact, I get this error on execution.
Any additional hint