Click here to Skip to main content
15,896,539 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionsprintf vs strcpy Pin
Blake Miller5-Dec-06 9:02
Blake Miller5-Dec-06 9:02 
AnswerRe: sprintf vs strcpy Pin
David Crow5-Dec-06 9:09
David Crow5-Dec-06 9:09 
AnswerRe: sprintf vs strcpy Pin
Zac Howland5-Dec-06 9:30
Zac Howland5-Dec-06 9:30 
AnswerRe: sprintf vs strcpy Pin
led mike5-Dec-06 9:43
led mike5-Dec-06 9:43 
GeneralRe: sprintf vs strcpy Pin
Zac Howland5-Dec-06 10:00
Zac Howland5-Dec-06 10:00 
GeneralRe: sprintf vs strcpy Pin
led mike5-Dec-06 10:31
led mike5-Dec-06 10:31 
AnswerRe: sprintf vs strcpy Pin
Stephen Hewitt5-Dec-06 12:08
Stephen Hewitt5-Dec-06 12:08 
Questionsimple code question Pin
CaptainChainsaw5-Dec-06 6:51
CaptainChainsaw5-Dec-06 6:51 
Hi there I am trying to understand some C++ code. I know the code below outputs "k=3 l=4". I would've thought that "++k+ ++k" would evaluate to "6", I don't see how "l" equals "4", can anyone explain this to me?

<br />
<br />
void main()<br />
{<br />
  int k=3;<br />
  int l;<br />
<br />
  l = sizeof(++k+ ++k);<br />
<br />
  printf("k=%d l=%d", k ,l);<br />
}<br />
<br />



Thanks in advance. Smile | :)
AnswerRe: simple code question Pin
Nemanja Trifunovic5-Dec-06 6:58
Nemanja Trifunovic5-Dec-06 6:58 
AnswerRe: simple code question Pin
David Crow5-Dec-06 7:18
David Crow5-Dec-06 7:18 
AnswerRe: simple code question Pin
zoid ! 5-Dec-06 7:28
zoid ! 5-Dec-06 7:28 
AnswerRe: simple code question Pin
includeh105-Dec-06 8:06
includeh105-Dec-06 8:06 
AnswerRe: simple code question Pin
CaptainChainsaw5-Dec-06 9:16
CaptainChainsaw5-Dec-06 9:16 
AnswerRe: simple code question Pin
Zac Howland5-Dec-06 9:34
Zac Howland5-Dec-06 9:34 
QuestionCTooltipCtrl Pin
Demian Panello5-Dec-06 6:28
Demian Panello5-Dec-06 6:28 
AnswerRe: CTooltipCtrl Pin
Wes Aday5-Dec-06 10:06
professionalWes Aday5-Dec-06 10:06 
QuestionHow to use MSFLexGrid in VC 2005 Pin
masnu5-Dec-06 5:42
masnu5-Dec-06 5:42 
AnswerRe: How to use MSFLexGrid in VC 2005 Pin
prasad_som6-Dec-06 18:49
prasad_som6-Dec-06 18:49 
QuestionBorder for rounded rectangle Pin
Super Hornet5-Dec-06 5:38
Super Hornet5-Dec-06 5:38 
AnswerRe: Border for rounded rectangle Pin
Waldermort5-Dec-06 6:24
Waldermort5-Dec-06 6:24 
QuestionRe: Border for rounded rectangle [modified] Pin
Super Hornet5-Dec-06 7:04
Super Hornet5-Dec-06 7:04 
GeneralRe: Border for rounded rectangle Pin
Mark Salsbery5-Dec-06 7:35
Mark Salsbery5-Dec-06 7:35 
QuestionRe: Border for rounded rectangle Pin
Super Hornet5-Dec-06 7:55
Super Hornet5-Dec-06 7:55 
AnswerRe: Border for rounded rectangle Pin
Mark Salsbery5-Dec-06 11:43
Mark Salsbery5-Dec-06 11:43 
QuestionLaHaHa - Joystick Questions Pin
Mark Salsbery5-Dec-06 5:36
Mark Salsbery5-Dec-06 5:36 

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.