I have a class (String) that I want to be able to implicitly convert to a char. How would I go about doing this? I know to do it the other way around, I just add a constructor that just takes a char as a parameter, but to convert from String to char implicitly? Thanks.

Recommended Answers

All 3 Replies

I have a class (String) that I want to be able to implicitly convert to a char. How would I go about doing this? I know to do it the other way around, I just add a constructor that just takes a char as a parameter, but to convert from String to char implicitly? Thanks.

This any help???:
http://support.microsoft.com/?kbid=311259

Actually, I just wanted to convert it to char (as in, a single character).

And, I did search, I just was obviously not using the right terms, IE conversion operator.

Thanks for your help!
Cody

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.