Click here to Skip to main content
15,925,133 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Recursive File Enumeration Pin
wayvirgo23-Sep-04 12:08
wayvirgo23-Sep-04 12:08 
GeneralRe: Recursive File Enumeration Pin
BlackDice24-Sep-04 3:20
BlackDice24-Sep-04 3:20 
QuestionHow about this? Pin
Tom Wright23-Sep-04 11:34
Tom Wright23-Sep-04 11:34 
AnswerRe: How about this? Pin
Michael Dunn23-Sep-04 11:42
sitebuilderMichael Dunn23-Sep-04 11:42 
GeneralRe: How about this? Pin
Tom Wright23-Sep-04 11:50
Tom Wright23-Sep-04 11:50 
GeneralRe: How about this? Pin
BlackDice23-Sep-04 11:59
BlackDice23-Sep-04 11:59 
GeneralRe: How about this? Pin
Tom Wright23-Sep-04 12:04
Tom Wright23-Sep-04 12:04 
GeneralRe: How about this? Pin
Michael Dunn23-Sep-04 12:03
sitebuilderMichael Dunn23-Sep-04 12:03 
To store the bytes into an int, I would do:
BYTE by[4] = { 0x30, 0x27, 0, 0 };
int n;
 
  n = *(int*) &by[0];
Keep in mind that the order of the bytes is CPU-specific. On x86 it's low->high as I showed above.

Tom Wright wrote:
And if I type cast it as an int then I get 0x0012f408 as a value, which is not right.

That's because a cast isn't a magical command that makes the compiler read your mind. Wink | ;) You need to understand exactly what a cast does, and avoid just "throwing in casts" hoping to make it work. (This isn't a flame, it's a difficult subject, I know.)
Casting by to int returns the value of &by[0], which in your case was 0x0012f408

--Mike--
Personal stuff:: Ericahist | Homepage
Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt
CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ

----
If my rhyme was a drug, I'd sell it by the gram.
GeneralRe: How about this? Pin
Tom Wright23-Sep-04 12:24
Tom Wright23-Sep-04 12:24 
GeneralRe: How about this? Pin
Tom Wright23-Sep-04 12:32
Tom Wright23-Sep-04 12:32 
GeneralRe: How about this? Pin
Michael Dunn23-Sep-04 15:13
sitebuilderMichael Dunn23-Sep-04 15:13 
GeneralRe: How about this? Pin
markkuk23-Sep-04 23:58
markkuk23-Sep-04 23:58 
General_CrtIsValidHeapPointer ASSERTS Pin
BlackDice23-Sep-04 10:43
BlackDice23-Sep-04 10:43 
GeneralRe: _CrtIsValidHeapPointer ASSERTS Pin
Michael Dunn23-Sep-04 11:45
sitebuilderMichael Dunn23-Sep-04 11:45 
GeneralRe: _CrtIsValidHeapPointer ASSERTS Pin
BlackDice23-Sep-04 11:51
BlackDice23-Sep-04 11:51 
GeneralTCHAR pointer character count Pin
Gimpy198323-Sep-04 9:53
Gimpy198323-Sep-04 9:53 
GeneralRe: TCHAR pointer character count Pin
João Paulo Figueira23-Sep-04 10:05
professionalJoão Paulo Figueira23-Sep-04 10:05 
GeneralRe: TCHAR pointer character count Pin
Gimpy198323-Sep-04 10:09
Gimpy198323-Sep-04 10:09 
GeneralRe: TCHAR pointer character count Pin
João Paulo Figueira23-Sep-04 11:06
professionalJoão Paulo Figueira23-Sep-04 11:06 
GeneralRe: TCHAR pointer character count Pin
Peter Weyzen23-Sep-04 11:32
Peter Weyzen23-Sep-04 11:32 
GeneralRe: TCHAR pointer character count Pin
Michael Dunn23-Sep-04 11:49
sitebuilderMichael Dunn23-Sep-04 11:49 
QuestionSource code formatter? Pin
Ravi Bhavnani23-Sep-04 9:53
professionalRavi Bhavnani23-Sep-04 9:53 
AnswerRe: Source code formatter? Pin
markkuk23-Sep-04 10:27
markkuk23-Sep-04 10:27 
GeneralRe: Source code formatter? Pin
Ravi Bhavnani23-Sep-04 12:31
professionalRavi Bhavnani23-Sep-04 12:31 
GeneralRecommend a free unit testing framework Pin
hyling23-Sep-04 9:44
hyling23-Sep-04 9:44 

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.