Click here to Skip to main content
15,895,656 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Hide cursor on CEdit? Pin
Mark Salsbery31-Oct-07 7:30
Mark Salsbery31-Oct-07 7:30 
GeneralRe: Hide cursor on CEdit? Pin
Gofur Halmurat31-Oct-07 9:10
Gofur Halmurat31-Oct-07 9:10 
GeneralRe: Hide cursor on CEdit? Pin
Mark Salsbery31-Oct-07 9:42
Mark Salsbery31-Oct-07 9:42 
GeneralRe: Hide cursor on CEdit? Pin
Gofur Halmurat31-Oct-07 10:08
Gofur Halmurat31-Oct-07 10:08 
QuestionRe: Hide cursor on CEdit? Pin
Mark Salsbery31-Oct-07 10:10
Mark Salsbery31-Oct-07 10:10 
QuestionRe: Hide cursor on CEdit? Pin
David Crow31-Oct-07 10:17
David Crow31-Oct-07 10:17 
AnswerRe: Hide cursor on CEdit? Pin
Mark Salsbery31-Oct-07 10:22
Mark Salsbery31-Oct-07 10:22 
AnswerRe: Hide cursor on CEdit? Pin
Gofur Halmurat1-Nov-07 0:17
Gofur Halmurat1-Nov-07 0:17 
QuestionRe: Hide cursor on CEdit? Pin
David Crow1-Nov-07 2:38
David Crow1-Nov-07 2:38 
AnswerRe: Hide cursor on CEdit? Pin
Gofur Halmurat1-Nov-07 3:53
Gofur Halmurat1-Nov-07 3:53 
QuestionRe: Hide cursor on CEdit? Pin
David Crow1-Nov-07 3:56
David Crow1-Nov-07 3:56 
AnswerRe: Hide cursor on CEdit? Pin
Gofur Halmurat1-Nov-07 4:12
Gofur Halmurat1-Nov-07 4:12 
QuestionRe: Hide cursor on CEdit? Pin
David Crow1-Nov-07 4:14
David Crow1-Nov-07 4:14 
AnswerRe: Hide cursor on CEdit? Pin
Gofur Halmurat1-Nov-07 4:30
Gofur Halmurat1-Nov-07 4:30 
QuestionRe: Hide cursor on CEdit? Pin
David Crow1-Nov-07 4:32
David Crow1-Nov-07 4:32 
AnswerRe: Hide cursor on CEdit? Pin
Gofur Halmurat1-Nov-07 4:39
Gofur Halmurat1-Nov-07 4:39 
GeneralRe: Hide cursor on CEdit? Pin
David Crow1-Nov-07 4:44
David Crow1-Nov-07 4:44 
GeneralRe: Hide cursor on CEdit? Pin
Gofur Halmurat1-Nov-07 4:49
Gofur Halmurat1-Nov-07 4:49 
QuestionConvert a char[ ] to int[ ] Pin
NYTSX31-Oct-07 4:59
NYTSX31-Oct-07 4:59 
AnswerRe: Convert a char[ ] to int[ ] Pin
Nelek31-Oct-07 5:10
protectorNelek31-Oct-07 5:10 
GeneralRe: Convert a char[ ] to int[ ] Pin
NYTSX31-Oct-07 5:19
NYTSX31-Oct-07 5:19 
AnswerRe: Convert a char[ ] to int[ ] [modified] Pin
George L. Jackson31-Oct-07 5:23
George L. Jackson31-Oct-07 5:23 
GeneralRe: Convert a char[ ] to int[ ] Pin
NYTSX31-Oct-07 7:28
NYTSX31-Oct-07 7:28 
GeneralRe: Convert a char[ ] to int[ ] Pin
Roger Stoltz31-Oct-07 7:57
Roger Stoltz31-Oct-07 7:57 
As I interpret your initial post, you may not get what you want with the proposed union solution.

NYTSX wrote:

tempChar[0] = 0x00;
tempChar[1] = 0x11;
tempChar[2] = 0x22;
tempChar[3] = 0x33;
tempChar[4] = 0x44;
tempChar[5] = 0x55;
tempChar[6] = 0x66;
tempChar[7] = 0x77;


This would in all systems, regardless of byte ordering, generate the following memory contents:
00 11 22 33 44 55 66 77

If you convert the memory contents above to two adjacent 32-bit integers you will, on a little-endian system like most systems running windows, get 0x33221100 and 0x77665544.

NYTSX wrote:
how do I get
tempInt[0] = 0x00112233;
tempInt[1] = 0x44556677;


My point is that the union solution will work on a big-endian system, but not on a little-endian system in terms of how I interpret your question.
To make a portable solution you would have to walk through the char array, one element at a time, and shift the integer value like Nelek suggested.



"It's supposed to be hard, otherwise anybody could do it!" - selfquote
"High speed never compensates for wrong direction!" - unknown

GeneralRe: Convert a char[ ] to int[ ] Pin
George L. Jackson31-Oct-07 8:06
George L. Jackson31-Oct-07 8:06 

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.