English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

8 answers

Yes that's a good question.
It's pass that value to the host program that ran it.

Like if your some program executed it then the value would be passed to your program only.
If you ran it through MSDOS as a host then the value would be passed to MSDOS(doesn't mean it's always meaningful, for the host).
If the host is Windows, then the value is passed to Windows.

Ok......
with an example.......



Program : "one.cpp" : -

#include
#include
void main() {
extern int main();
cout< }



Program : "two.cpp" : -

#include
int main() {
return 653;
}

the program "one.cpp" should print 635. here the host program is one.cpp ..

2006-11-25 20:34:07 · answer #1 · answered by Sunny 3 · 1 0

It will return the int value on the Command prompt where you have called this main method.

2006-11-25 20:20:14 · answer #2 · answered by sushil 2 · 0 0

it will be returned in a data type which is int that was used by other method or procedure..actually when you are declaring the int main(), you need to return the value using a procedure also..
the one inside the method main() that is lastly produced will saved in as int main() and the main as the identifier..

2006-11-25 21:20:20 · answer #3 · answered by angelvein 2 · 0 0

The Value is returned to the operating system(OS).
it helps th OS to determine whether an error occurred or not.

for example u write exit(0);

0 mean no error occurred, instead u can pass some error code for the OS to take action if its an fatal exception occurring in ur program

2006-11-26 17:04:38 · answer #4 · answered by Anonymous · 0 1

purely positioned... you could no longer. Java facilitates in basic terms a single return. in case you finally end up wanting to try this, this is many times a flaw in the layout. in case you *surely* ought to try this, and there is not extra useful way, you could desire to consistently whip up a Tuple classification that holds n-tuples. in certainty you will possibly create it as a accepted and then define the types in the tuple once you create it to insure form-protection.

2016-10-17 13:40:27 · answer #5 · answered by canevazzi 4 · 0 0

It's returned as an "error level". Different environments (Unix, DOS, Windows, etc.) treat these values differently, and offer different commands for checking these values and acting on them.

2006-11-25 20:46:19 · answer #6 · answered by watsonc64 3 · 0 1

it will return to the parent process or thred

ex: program called pro1.exe
main () { return 15;} -- is the program \

i will run this in the command line
set xx [pro1.exe ]
xx will have the answer 15

2006-11-26 18:08:10 · answer #7 · answered by sathish.kulal 2 · 0 0

In the standard input output file

2006-11-25 20:26:33 · answer #8 · answered by rekpb 1 · 0 0

fedest.com, questions and answers