473,326 Members | 2,815 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,326 software developers and data experts.

C- Are there any other statements that serve the function of returning control to OS?

AmberJain
884 Expert 512MB
HELLO,

One C programming book says:
In ANSI C, it is customary, although not required, to include a statement in main() which explicitly returns control to Operating System
I can think of only two statements that can serve the function of returning control to Operating System i.e.

return 0;

exit(0);

Now my question is that-"Are there any other statements than I mentioned above that serve the function of returning control to OS?"

THANKS in advance......
Jul 22 '08 #1
3 1330
JosAH
11,448 Expert 8TB
There's also the Standard abort() function ...

kind regards,

Jos
Jul 22 '08 #2
weaknessforcats
9,208 Expert Mod 8TB
The only valid returns from main(), exit(), etc are 0 and 1. All others are indeterminate. What the operating system does with this is also indeterminate.
Jul 22 '08 #3
Banfa
9,065 Expert Mod 8TB
Throw any sort of exception (out of bounds memory access for instance) that causes your program to crash.

Of course the exact state of you entire computer system will be indeterminate on many platforms after this.
Jul 22 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Jochen Zeischka | last post by:
I'm puzzled. When compiling this: template<class ValRes, class Val1, class Val2> Veld<ValRes>& mult(Veld<ValRes>& res, const Veld<Val1>& v1, const Veld<Val2>& v2) { // something return res; }...
5
by: shyam | last post by:
Hi All I have to write a function which basically takes in a string and returns an unknown number( at compile time) of strings i hav the following syntax in mind char *tokenize(char *) ...
14
by: Protoman | last post by:
How would you write a function returning a function pointer and why would you need to do this? Is it: int(*)(int&) fn(int& arg); Thanks!!!
2
by: Tany | last post by:
How can I declare function returning array of Integer pointers . Please help !!
17
by: I.M. !Knuth | last post by:
Hi. I'm more-or-less a C newbie. I thought I had pointers under control until I started goofing around with this: ...
14
by: Fabian Steiner | last post by:
Hello! I have got a Python "Device" Object which has got a attribute (list) called children which my contain several other "Device" objects. I implemented it this way in order to achieve a kind...
18
by: svata | last post by:
Hello to all, as a result from my previous post I'm busy with splitting code into functions. The one problem ( out of many ) I encounter is how to properly use/code a function which returns...
7
by: | last post by:
I have what's probably a simple page lifecycle question related to dynamically evaluating values that are placed by a repeater and dynmically placing user controls that use those values. I'm...
3
by: John Turner | last post by:
typedef void (*vfp)(); typedef vfp (*fp)(); static fp hello() { printf("Hello.\n"); return (fp)&hello; } main(){
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.