Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

function call in for loop condition

Name: Anonymous 2009-02-28 2:29

I got into an argument with a co-worker today about this snippet:


for (int i = 0; i < foo(); i++)
{
}


I told him that he shouldn't put the foo() function in the termination check of that for loop. He said that the compiler actually assigns the result of foo() to a variable and then sticks that in where foo() is at. I said that we can't rely on that. We're working in C++ on .NET. Who's right?

Name: Anonymous 2009-02-28 4:12

>>9
>Be it HTML, C++, Java or whatever language you prefer, programming is what we do best around this board.

Sorry, stopped reading right there. Sepples, Java and HTML are not considered languages.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List