Can someone please explain the meaning of these return 1 vs return 0 vs break. I know 1 generally means true and 0 generally means false but how would they effect a return statement? Also when would you wanna use a return statement instead of a break statement and vice versa?
Jump to Post
return x;will return the value x to the calling routine. If you called the function with
rt = func();rt will contain whatever x was.
break;will immediately exit a loop even though the loop is not finished.
for (i=0; i<10; i++) …
All 8 Replies
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.