Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2009-05-20
4
Medium Priority
?
1,037 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 2000 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
Suggested Courses

916 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