Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unicode to ansi

Status
Not open for further replies.

ollen

Technical User
Oct 21, 2004
2
GB
What is the VC command for VB chr (Returns the character associated with the specified ANSI character code.) function ?
 
WideCharToMultiByte converts strings, if you just want to convert a single character I think you can just cast it normally (char c = (char)OtherChar;).
 
Will that give me like with the chr function ?

ex:
MyChar = Chr(65) ' Returns A.
MyChar = Chr(97) ' Returns a.
 
There is no need for 'convect char to ascii or vice-versa' functions in C++ since the char type is actually an integer itself.

ie
Code:
  char ch1 = 'A'; // 'A' is really just another way of writing 65 
  char ch2 = 65; // ch2 == 'A'

  char ch3 = 'A' + 1; // ch3 == 'B'



/Per
[sub]
"It was a work of art, flawless, sublime. A triumph equaled only by its monumental failure."[/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top