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

C / C++ / MFC

 
AnswerRe: Window's Client RECT in Screen Coordinates? Pin
ThatsAlok15-Feb-05 18:09
ThatsAlok15-Feb-05 18:09 
AnswerRe: Window's Client RECT in Screen Coordinates? Pin
InflatableGarfield15-Feb-05 22:09
InflatableGarfield15-Feb-05 22:09 
GeneralwaveInOpen and waveInProc problem. Pin
anaknakal15-Feb-05 11:39
anaknakal15-Feb-05 11:39 
GeneralRe: waveInOpen and waveInProc problem. Pin
vinnzy15-Feb-05 18:53
vinnzy15-Feb-05 18:53 
GeneralRe: waveInOpen and waveInProc problem. Pin
anaknakal15-Feb-05 20:46
anaknakal15-Feb-05 20:46 
GeneralRe: waveInOpen and waveInProc problem. Pin
Sapto Priyono15-Feb-05 20:09
Sapto Priyono15-Feb-05 20:09 
GeneralRe: waveInOpen and waveInProc problem. Pin
anaknakal15-Feb-05 20:52
anaknakal15-Feb-05 20:52 
Questionfor ( ; i < 5; i++) ? Pin
Link260015-Feb-05 11:33
Link260015-Feb-05 11:33 
In C++, we can declare and initialize the variable i inside the for condition. However, in C, we can't do that, we must declare it first. But almost all the time when I declare a variable, I will initialize it at the same time, this makes re-initializing variable i in for loop unnecessary.

I was wondering would that be considered poor programming style? I've seen this style a lot.

// C code
 <br />
int i = 0;<br />
<br />
for( ; i < 5; i++)<br />
{<br />
// code<br />
}<br />


or should I?

<br />
int i = 0;<br />
<br />
for(i = 0; i < 5; i++)<br />
{<br />
//code<br />
}<br />


Thanks
AnswerRe: for ( ; i &lt; 5; i++) ? Pin
Maximilien15-Feb-05 12:28
Maximilien15-Feb-05 12:28 
GeneralRe: for ( ; i < 5; i++) ? Pin
Link260015-Feb-05 17:29
Link260015-Feb-05 17:29 
GeneralRe: for ( ; i &lt; 5; i++) ? Pin
Antony M Kancidrowski15-Feb-05 23:09
Antony M Kancidrowski15-Feb-05 23:09 
AnswerRe: for ( ; i &lt; 5; i++) ? Pin
Ryan Binns15-Feb-05 17:34
Ryan Binns15-Feb-05 17:34 
AnswerRe: for ( ; i &lt; 5; i++) ? Pin
namaskaaram15-Feb-05 22:37
namaskaaram15-Feb-05 22:37 
QuestionWhat is the max length of tree branche? Pin
bilas15-Feb-05 7:52
bilas15-Feb-05 7:52 
AnswerRe: What is the max length of tree branche? Pin
rocky_pulley15-Feb-05 9:03
rocky_pulley15-Feb-05 9:03 
GeneralRe: What is the max length of tree branche? Pin
bilas15-Feb-05 11:03
bilas15-Feb-05 11:03 
Generalcheck if PC connects to the internet Pin
includeh1015-Feb-05 5:49
includeh1015-Feb-05 5:49 
GeneralRe: check if PC connects to the internet Pin
Ravi Bhavnani15-Feb-05 8:58
professionalRavi Bhavnani15-Feb-05 8:58 
GeneralRe: check if PC connects to the internet Pin
David Crow15-Feb-05 10:57
David Crow15-Feb-05 10:57 
GeneralRe: check if PC connects to the internet Pin
includeh1015-Feb-05 22:48
includeh1015-Feb-05 22:48 
QuestionWinSOCK and HTTP POST - how to send/receive data? Pin
Peter Laursen15-Feb-05 5:08
Peter Laursen15-Feb-05 5:08 
AnswerRe: WinSOCK and HTTP POST - how to send/receive data? Pin
Ravi Bhavnani15-Feb-05 9:01
professionalRavi Bhavnani15-Feb-05 9:01 
GeneralRe: WinSOCK and HTTP POST - how to send/receive data? Pin
humps15-Feb-05 9:44
humps15-Feb-05 9:44 
GeneralRe: WinSOCK and HTTP POST - how to send/receive data? Pin
Peter Laursen16-Feb-05 0:05
Peter Laursen16-Feb-05 0:05 
GeneralRe: WinSOCK and HTTP POST - how to send/receive data? Pin
humps16-Feb-05 9:09
humps16-Feb-05 9:09 

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.