Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.
Login
Login
OnlineGDB Q&A
Questions
Unanswered
Tags
Ask a Question
Ask a Question
return 0 defines what
0
votes
asked
Aug 14, 2018
by
ganesh2000s
(
190
points)
Your answer
Your name to display (optional):
Email me at this address if my answer is selected or commented on:
Email me if my answer is selected or commented on
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please
log in
or register.
1 Answer
0
votes
answered
Aug 17, 2018
by
Arun Sai
(
140
points)
The
return
value of the main function is considered the "Exit Status" of the application.
commented
Aug 18, 2018
by
Ethan Alexander Lee
(
580
points)
In the main function, return is a way to complete a programs functionality successful or not.
For example.
#include <iostream>
using namespace std;
int main(){
bool fileFound = false;
//Find file then set the bool.
if (!fileFound){
cout<<"Error: File couldn't be loaded."
return 1;
}
//continue the program
return 0;
}
commented
Aug 18, 2018
by
Ethan Alexander Lee
(
580
points)
returning 1 means error, while returning 0 means success.
Your comment on this answer:
Your name to display (optional):
Email me at this address if a comment is added after mine:
Email me if a comment is added after mine
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please
log in
or register.
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...