Click here to Skip to main content
15,922,584 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: string to unsigned char conversion using vc++ Pin
ThatsAlok12-Apr-05 19:30
ThatsAlok12-Apr-05 19:30 
GeneralRe: string to unsigned char conversion using vc++ Pin
22491712-Apr-05 19:34
22491712-Apr-05 19:34 
GeneralRe: string to unsigned char conversion using vc++ Pin
ThatsAlok12-Apr-05 20:19
ThatsAlok12-Apr-05 20:19 
GeneralRe: string to unsigned char conversion using vc++ Pin
22491712-Apr-05 20:28
22491712-Apr-05 20:28 
GeneralRe: string to unsigned char conversion using vc++ Pin
nehathoma12-Apr-05 21:05
nehathoma12-Apr-05 21:05 
GeneralRe: string to unsigned char conversion using vc++ Pin
ThatsAlok12-Apr-05 21:10
ThatsAlok12-Apr-05 21:10 
GeneralRe: string to unsigned char conversion using vc++ Pin
22491712-Apr-05 21:18
22491712-Apr-05 21:18 
GeneralRe: string to unsigned char conversion using vc++ Pin
John R. Shaw12-Apr-05 19:44
John R. Shaw12-Apr-05 19:44 
I'll assume you mean an unsigned character string.

1) A string (by default) is a signed character array ending with a null character ('\0').

2) "string" is of type (char*).

3) To treat a string as an unsigned character string:
char* pStr = "string";
unsigned char* puStr = (unsigned char*)pStr;

3) To convert and individule character (in a string) from signed to unsigned:
unsigned char uch = (unsigned char)pStr[i];

That's all there is to it.

INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
GeneralProblem with CListCtrl Pin
Neeranjan12-Apr-05 18:32
Neeranjan12-Apr-05 18:32 
GeneralSet link to text on dialog box Pin
Anonymous12-Apr-05 17:51
Anonymous12-Apr-05 17:51 
GeneralRe: Set link to text on dialog box Pin
ThatsAlok12-Apr-05 18:28
ThatsAlok12-Apr-05 18:28 
GeneralRe: Set link to text on dialog box Pin
John R. Shaw12-Apr-05 18:31
John R. Shaw12-Apr-05 18:31 
GeneralRe: Set link to text on dialog box Pin
Anonymous12-Apr-05 19:10
Anonymous12-Apr-05 19:10 
GeneralRegular expression Pin
John R. Shaw12-Apr-05 16:48
John R. Shaw12-Apr-05 16:48 
GeneralRe: Regular expression Pin
LighthouseJ12-Apr-05 16:58
LighthouseJ12-Apr-05 16:58 
GeneralRe: Regular expression Pin
Christian Graus12-Apr-05 17:47
protectorChristian Graus12-Apr-05 17:47 
GeneralRe: Regular expression Pin
John R. Shaw12-Apr-05 18:51
John R. Shaw12-Apr-05 18:51 
GeneralRe: Regular expression Pin
John R. Shaw12-Apr-05 18:11
John R. Shaw12-Apr-05 18:11 
QuestionWM_CHAR, WM_KEYDOWN??? Pin
Hamed Musavi12-Apr-05 16:39
Hamed Musavi12-Apr-05 16:39 
AnswerRe: WM_CHAR, WM_KEYDOWN??? Pin
Christian Graus12-Apr-05 17:49
protectorChristian Graus12-Apr-05 17:49 
GeneralRe: WM_CHAR, WM_KEYDOWN??? Pin
Hamed Musavi14-Apr-05 15:41
Hamed Musavi14-Apr-05 15:41 
GeneralRe: WM_CHAR, WM_KEYDOWN??? Pin
Christian Graus14-Apr-05 15:43
protectorChristian Graus14-Apr-05 15:43 
GeneralRe: WM_CHAR, WM_KEYDOWN??? Pin
Hamed Musavi14-Apr-05 15:47
Hamed Musavi14-Apr-05 15:47 
GeneralFolder Calls Pin
JWood12-Apr-05 16:20
JWood12-Apr-05 16:20 
GeneralRe: Folder Calls Pin
David Crow12-Apr-05 17:01
David Crow12-Apr-05 17:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.