N
Neil Zanella
Hello,
I would like to ask the following question concerning the C# as operator.
I would like to know whether the difference between using a C-style cast
such as
double x = 0;
float y = (double) x;
and using the as operator is simply that as works on references rather
than on primitive data types. So using the as operator in C# should be
roughly equivalent to casting a pointer type to another in C. I would
like to know though, does anything in particular happen when a concersion
from one reference type to another takes place in C# using the as keyword?
In particular, how does the as keyword work under the hood?
Thanks,
Neil
I would like to ask the following question concerning the C# as operator.
I would like to know whether the difference between using a C-style cast
such as
double x = 0;
float y = (double) x;
and using the as operator is simply that as works on references rather
than on primitive data types. So using the as operator in C# should be
roughly equivalent to casting a pointer type to another in C. I would
like to know though, does anything in particular happen when a concersion
from one reference type to another takes place in C# using the as keyword?
In particular, how does the as keyword work under the hood?
Thanks,
Neil