Solved

C#: How to assign const chars by their hex values?

Posted on 2009-05-20
4
1,017 Views
Last Modified: 2013-12-17
Hi all,

I know in C you can assign const chars like so:

const char cSpaceSymbol = 0x20;

What is the C# equivalent? I want to assign const chars based solely upon the hex value. Thanks in advance!
0
Comment
Question by:ehensens
  • 2
  • 2
4 Comments
 

Author Comment

by:ehensens
ID: 24435492
Or the decimal value, obviously.
0
 
LVL 40

Accepted Solution

by:
mrjoltcola earned 500 total points
ID: 24435503
Try:

char ch = (char)0x20;
0
 

Author Comment

by:ehensens
ID: 24435515
Didn't think it'd be that easy & quick, thanks!
0
 
LVL 40

Expert Comment

by:mrjoltcola
ID: 24435546
Welcome!
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now