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?
COKEDUDE
27
Junior Poster in Training
Recommended Answers
Jump to Post
return x;
will return the value x to the calling routine. If you called the function withrt = 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++) …
Jump to PostYou realy should google C functions and C control statements....You'll find the answers in these queries...
All 8 Replies
WaltP
2,905
Posting Sage w/ dash of thyme
Team Colleague
gerard4143
371
Nearly a Posting Maven
COKEDUDE
27
Junior Poster in Training
Dave Sinkula
2,398
long time no c
Team Colleague
COKEDUDE
27
Junior Poster in Training
WaltP
2,905
Posting Sage w/ dash of thyme
Team Colleague
COKEDUDE
27
Junior Poster in Training
WaltP
2,905
Posting Sage w/ dash of thyme
Team Colleague
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.