Jump to content

Home

more questions lol


Coasterdude

Recommended Posts

lets say for example there is a function

SomeFunction(stuff)

then under it there is

if ( something == 1 )

{

return;

}

So if the IF is true, does the "return;" make it leave the SomeFunction(stuff) function?

More Questions:

When/Why/Should I use "break;"

When/Why/Should I use loops

Sorry for the newb questions lol. I really love programming and I want to learn :D .

Link to comment
Share on other sites

If I understand you question right:

break; - is to stop loops ( for, while,... )

return; - is to make the function return, for example:

int function() { //this function should return an int

return 1; //this function returns 1 and ends.

}

 

You should read a programming book, or something...

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...