473,395 Members | 2,006 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

main-return ???

what is the ((((return any no;))) in the main mean plz
Ex.
int main()
{

;
;
;
return ??;

}

Mar 2 '06 #1
5 2684
# include ha scritto:
what is the ((((return any no;))) in the main mean plz
Ex.
int main()
{

;
;
;
return ??;

}


That's the "exit code".

For example, a "return 0" or "return EXIT_SUCCESS" means that no errors
occured.

You could also google for "exit codes", and see if there's anywhere a
list available (I don't really know, sorry)

Hope this helps,

David

--
Linux Registered User #334216
Get FireFox! >> http://www.spreadfirefox.com/?q=affiliates&id=48183&t=1
Staff >> http://www.debianizzati.org <<
Mar 2 '06 #2

# include wrote:
what is the ((((return any no;))) in the main mean plz
Ex.
int main()
int main(void)

is better, as it spells out your intention.
{

;
;
;
return ??;

}


You should try and make your questions clearer.

My guess is that you want to know how to return a value from `main()`.
As `main()` returns an `int`, you can use any expression that returns
that type (including implicit promotion). E.g. given:

int i = 42;
double x = 42.0;

all of the following are OK:

return 0;
return 37+5;
return i;
return x;
return (int)x;
return EXIT_SUCCESS;
return EXIT_FAILURE;

As for the meaning of the value returned, 0 means success, as well as
EXIT_SUCCESS. You should indicate failure using EXIT_FAILURE. How the
underlying OS (if any) interprets these values is outside the scope of
the C Standard. Both are defined in <stdlib.h>.

Mar 2 '06 #3
"# include" <wa*********@yahoo.com> writes:
what is the ((((return any no;))) in the main mean plz
Ex.
int main()
{

;
;
;
return ??;

}


I'm guessing that "no" means "number", and "plz" means "please". If
you took the time to spell out the words, I wouldn't have to guess.
Abbreviations like that make what you write more difficult to read.

As for the value returned by main, any decent C textbook or tutorial
should answer this elementary question.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Mar 2 '06 #4

"David Paleino" <d.*******@gmail.com> wrote in message
news:du**********@area.cu.mi.it...
# include ha scritto:
what is the ((((return any no;))) in the main mean plz
Ex.
int main()
{

;
;
;
return ??;

}


That's the "exit code".

For example, a "return 0" or "return EXIT_SUCCESS" means that no errors
occured.

You could also google for "exit codes", and see if there's anywhere a
list available (I don't really know, sorry)

A portable program can return 0 (success), EXIT_SUCCESS (success) or
EXIT_FAILURE (terminate without accomplishing intended purpose).

Other codes are platform-dependent.

--
Buy my book 12 Common Atheist Arguments (refuted)
$1.25 download or $6.90 paper, available www.lulu.com
Mar 2 '06 #5
It says that the main function must return a int type code, default 0
indicate successful.
"# include" <wa*********@yahoo.com> ????
news:11**********************@t39g2000cwt.googlegr oups.com...
what is the ((((return any no;))) in the main mean plz
Ex.
int main()
{

;
;
;
return ??;

}

Mar 3 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

20
by: andre | last post by:
HI, I’m learning C# and already know VB .Net. I noticed that C# you have a Static Void Main () (entry point of the app). Well that got me thinking, I was told that VB.net removed “The...
45
by: Steven T. Hatton | last post by:
This is a purely *hypothetical* question. That means, it's /pretend/, CP. ;-) If you were forced at gunpoint to put all your code in classes, rather than in namespace scope (obviously classes...
75
by: Beni | last post by:
I have been programming in C for about a year now. It sounds silly, but I never took the time to question why a C(or C++ or Java) program execution begins only at the main(). Is it a convention or...
5
by: Guruz | last post by:
hi C gurus do anyone of u know how to write a program in C without main and still create a executable out of it. Remember, I said no main() function not in -->include files -->libraries -->no...
13
by: Sokar | last post by:
I have my main function set up as int main(int argv, char *argv) so taht i can read in a variable which is passed to the program on the command line. The problem is that main calls other...
16
by: Geoff Jones | last post by:
Hi What is the closest equivalent to Main in a VB.Net form? Geoff
2
by: psuaudi | last post by:
I have a main query that I would like to call two different subqueries. In MS Access, I usually just save the two subqueries as separate queries which are then called by a third separate and main...
2
by: =?ISO-8859-15?Q?Luigi_Malag=F2?= | last post by:
Hello, i'm having a problem with "multiple definition error" linking a library. I have a program with a main. I have another program with classes and a main too. I created a library of the second...
4
by: urkel | last post by:
Hello everybody, I am getting bogged-down by these errors troubling me for the last few days I am writing a C program with a main and several user-defined functions. One of the user-defined...
80
by: Ioannis Vranos | last post by:
Hi, in C90 is "int main()" valid, the same as "int main(void)" and "int main(int argc, char *argv)"? AFAIK in C99 only "int main(void)" and "int main(int argc, char *argv) - and the **argv...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.