Click here to Skip to main content
15,904,497 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: DWORD dw='pp' is valid in VC++ 6.0 :( Pin
toxcct7-Nov-07 0:07
toxcct7-Nov-07 0:07 
GeneralRe: DWORD dw='pp' is valid in VC++ 6.0 :( Pin
Raj Prathap7-Nov-07 0:20
Raj Prathap7-Nov-07 0:20 
GeneralRe: DWORD dw='pp' is valid in VC++ 6.0 :( Pin
toxcct7-Nov-07 0:23
toxcct7-Nov-07 0:23 
GeneralRe: DWORD dw='pp' is valid in VC++ 6.0 :( Pin
Raj Prathap7-Nov-07 0:30
Raj Prathap7-Nov-07 0:30 
GeneralRe: DWORD dw='pp' is valid in VC++ 6.0 :( Pin
CPallini7-Nov-07 0:44
mveCPallini7-Nov-07 0:44 
GeneralRe: DWORD dw='pp' is valid in VC++ 6.0 :( Pin
Raj Prathap21-Nov-07 4:01
Raj Prathap21-Nov-07 4:01 
GeneralYou're welcome Pin
CPallini21-Nov-07 4:24
mveCPallini21-Nov-07 4:24 
AnswerRe: DWORD dw='pp' is valid in VC++ 6.0 :( Pin
Nishad S7-Nov-07 0:35
Nishad S7-Nov-07 0:35 
Raj Prathap wrote:
was not aware that is a valid statement.


It is a valid statement.

Raj Prathap wrote:
And still I'm not clear what will be the value of dw.


DWORD is four bytes long. The higher two bytes will be 0 and the lower two bytes will be the value 'p'. Like 0x00007070. And if it was 'pa' then value would be 0x00007061. Also upto 4 characters are possible. For example dw = 'abcd' means 0x61626364.

Raj Prathap wrote:
I calculated if it is equivalent to ('p'<<8 + 'p') but no success.


The problem caused with your code is the precedence of operators. Try
DWORD dw = ( 'p' << 8 ) + 'a';

- NS -

AnswerRe: DWORD dw='pp' is valid in VC++ 6.0 :( Pin
Don Box7-Nov-07 0:56
Don Box7-Nov-07 0:56 
AnswerRe: DWORD dw='pp' is valid in VC++ 6.0 :( Pin
David Crow7-Nov-07 4:32
David Crow7-Nov-07 4:32 
QuestionRead Console Output Pin
nitin36-Nov-07 23:39
nitin36-Nov-07 23:39 
AnswerRe: Read Console Output Pin
Raj Prathap6-Nov-07 23:45
Raj Prathap6-Nov-07 23:45 
GeneralRe: Read Console Output Pin
Matthew Faithfull7-Nov-07 0:02
Matthew Faithfull7-Nov-07 0:02 
QuestionRe: Read Console Output Pin
David Crow7-Nov-07 4:34
David Crow7-Nov-07 4:34 
QuestionAbout Memory initialization Pin
manish.patel6-Nov-07 23:30
manish.patel6-Nov-07 23:30 
AnswerRe: About Memory initialization Pin
Raj Prathap6-Nov-07 23:52
Raj Prathap6-Nov-07 23:52 
AnswerRe: About Memory initialization Pin
jhwurmbach6-Nov-07 23:56
jhwurmbach6-Nov-07 23:56 
GeneralRe: About Memory initialization Pin
toxcct7-Nov-07 0:11
toxcct7-Nov-07 0:11 
GeneralRe: About Memory initialization Pin
jhwurmbach7-Nov-07 0:35
jhwurmbach7-Nov-07 0:35 
GeneralRe: About Memory initialization Pin
Nemanja Trifunovic7-Nov-07 3:48
Nemanja Trifunovic7-Nov-07 3:48 
GeneralRe: About Memory initialization Pin
jhwurmbach7-Nov-07 3:52
jhwurmbach7-Nov-07 3:52 
GeneralRe: About Memory initialization Pin
Nemanja Trifunovic7-Nov-07 4:17
Nemanja Trifunovic7-Nov-07 4:17 
GeneralRe: About Memory initialization Pin
Matthew Faithfull6-Nov-07 23:58
Matthew Faithfull6-Nov-07 23:58 
GeneralRe: About Memory initialization Pin
toxcct7-Nov-07 0:13
toxcct7-Nov-07 0:13 
AnswerRe: About Memory initialization Pin
toxcct7-Nov-07 0:08
toxcct7-Nov-07 0:08 

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.