Explain the components of the standard C/C++
main()
function definition below.
int main(int argc, char* argv[]) {
int returnValue = 0;
// implementation of main’s functional code not shown ...
return returnValue;
}
//here our main function starts here
//the int keyword in the below function tells function has to return int value. argc , argv are two keywords which are used to pass command line arguments.
argc : is used to receive number of arguments that the program needs
argv : is the vector of those arguments with values
//function starts here
int main(int argc, char* argv[]) {
//declaring a variable named returnValue which is intialized to 0
int returnValue = 0;
// implementation of main’s functional code not shown ...
//returning the variable which has zero value
return returnValue;
//function ends here
}
Get Answers For Free
Most questions answered within 1 hours.