Why you can’t cast an integer to a string.
I saw this question last Thursday on Channel 9 that I’ve heard before. My guess is that there are enough people who have the same question that it’s worth addressing.
I know there’s probably a really good reason for this, but I can’t think of what it is, and it keeps bugging me. Why can’t you do
int x = 10;
string y = (string)x;
in C#? I mean, you could simply use x.ToString(), but why doesn’t the explicit cast do the same?
If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!

