Click here to Skip to main content
15,920,704 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Enable MFC in Win32 DLL Pin
Cedric Moonen1-Mar-09 21:47
Cedric Moonen1-Mar-09 21:47 
GeneralRe: Enable MFC in Win32 DLL Pin
PankajB1-Mar-09 21:50
PankajB1-Mar-09 21:50 
AnswerRe: Enable MFC in Win32 DLL Pin
«_Superman_»1-Mar-09 21:51
professional«_Superman_»1-Mar-09 21:51 
GeneralRe: Enable MFC in Win32 DLL Pin
PankajB1-Mar-09 21:56
PankajB1-Mar-09 21:56 
Questionstring to hex number Pin
lune121-Mar-09 20:50
lune121-Mar-09 20:50 
AnswerRe: string to hex number Pin
grassrootkit1-Mar-09 21:13
grassrootkit1-Mar-09 21:13 
AnswerRe: string to hex number Pin
Cedric Moonen1-Mar-09 21:22
Cedric Moonen1-Mar-09 21:22 
AnswerRe: string to hex number Pin
Stuart Dootson1-Mar-09 21:26
professionalStuart Dootson1-Mar-09 21:26 
lune12 wrote:
I have tried:

char* str = "23";
char c;
sscanf(str, "%x", &c);


but the char c is 4 bytes in memory and this is not safe!!!


That's because %x indicates you want to read an integer. Read it into an integer, bounds check it if you want, then assign it to the character.

If you want to ensure you only read 2 hex characters from the input, use a width specification, like this:

sscanf(str, "%2x", &int_value);


Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

AnswerRe: string to hex number Pin
CPallini1-Mar-09 22:49
mveCPallini1-Mar-09 22:49 
AnswerRe: string to hex number Pin
cmk2-Mar-09 8:46
cmk2-Mar-09 8:46 
QuestionCut the wmv movie Using Directshow editing services Pin
raj15761-Mar-09 19:37
raj15761-Mar-09 19:37 
Questionmultilingual support Pin
Varun Bhatt1-Mar-09 19:30
Varun Bhatt1-Mar-09 19:30 
AnswerRe: multilingual support Pin
Hamid_RT1-Mar-09 19:57
Hamid_RT1-Mar-09 19:57 
Question2 Doc & 2 Views. Pin
grassrootkit1-Mar-09 19:26
grassrootkit1-Mar-09 19:26 
AnswerRe: 2 Doc & 2 Views. Pin
Stuart Dootson1-Mar-09 21:37
professionalStuart Dootson1-Mar-09 21:37 
GeneralRe: 2 Doc & 2 Views. Pin
grassrootkit1-Mar-09 22:40
grassrootkit1-Mar-09 22:40 
GeneralRe: 2 Doc & 2 Views. Pin
Stuart Dootson1-Mar-09 23:12
professionalStuart Dootson1-Mar-09 23:12 
GeneralRe: 2 Doc & 2 Views. Pin
grassrootkit1-Mar-09 23:38
grassrootkit1-Mar-09 23:38 
QuestionC question about Split and remove substring Pin
nyc_6801-Mar-09 19:04
nyc_6801-Mar-09 19:04 
AnswerRe: C question about Split and remove substring Pin
Nishad S1-Mar-09 19:16
Nishad S1-Mar-09 19:16 
GeneralRe: C question about Split and remove substring Pin
nyc_6801-Mar-09 19:45
nyc_6801-Mar-09 19:45 
AnswerRe: C question about Split and remove substring Pin
sam_psycho1-Mar-09 20:01
sam_psycho1-Mar-09 20:01 
QuestionUnable to create SAFEARRAY Pin
pandit841-Mar-09 18:56
pandit841-Mar-09 18:56 
AnswerRe: Unable to create SAFEARRAY Pin
Stuart Dootson1-Mar-09 21:48
professionalStuart Dootson1-Mar-09 21:48 
GeneralRe: Unable to create SAFEARRAY Pin
pandit841-Mar-09 23:04
pandit841-Mar-09 23:04 

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.