I am new to C#
I have a struct like
struct Package
{
Public int[] intvalues;
Public char[] charvalues;
Public string strvalue;
}
Now I have a string
string strquery;
I want to take the value of intvalues of the Package whose name is strquery.
As far as I tried, this didnt work
(Package)strquery.strvalue
Please help
Well, you can’t do anything like that. Because for a string isn’t defined any explicit casting operator such as your struct Package.
Also, the strquery.strvalue is completely wrong, as the string doesn’t have such a field.
You can try what Phaedrus said.
From what you’ve said until now I think you are doing something like this: