当前位置:网站首页>Exit() function, macro exit_ Success, macro exit_ Difference between failure, exit() and return
Exit() function, macro exit_ Success, macro exit_ Difference between failure, exit() and return
2022-06-21 14:31:00 【Modest learning and progress】
exit() Function closes all open files and terminates the program .
exit() The parameters of the function will be passed to some operating systems , The usual convention is that normally terminated programs pass values 0, An abnormally terminated program passes an exception 0 value . Different exit values may be used to identify different causes of program failure ,ANSIC The standard requires the use of values 0 Or macro EXIT_SUCCESS To indicate that the program terminated successfully , Use macros EXIT_FAILURE Indicates that the program aborted unsuccessfully .( The macro and exit() Prototype stay stdlib.h You can find it in the header file EXIT_SUCCESS EXIT_FAILURE)
according to ANSIC, In the initial call main Use and call... In functions exit() The effect is the same , stay main() We use the statement
return 0;
exit(0);
The function of the two statements is the same
Be careful If main() In a recursive program ,exit The function will still terminate the program , however return Hand over control to the recursive upper level , Up to the first level , here return Will terminate the program . return and exit Another difference is , And make in addition main In addition to functions exit() It also terminates the program
边栏推荐
- 使用api制作我的足迹地图
- The code remotely calls aria2 to download URL resources or BT seeds
- Write a compile time annotation
- Tcp/ip FAQs
- Mqtt keepalive and reconnect
- Define structure dynamically when macro is defined
- Technology sharing | a clustering incremental statistical SQL requirement in MySQL
- Redis learning (3) -- persistence mechanism
- Don't know how to interview? Test interview questions summary, teach you to face the interview questions
- Installation of oracle19c under alicloud lightweight application server linux-centos7
猜你喜欢

Async get and post request interface data (add, delete, modify and query pages)

Oracle client11 and pl/sql12 installation

JS written test question: array

Disputes between chromedriver, geckodriver, microsoftwebdriver, iedriverserver and operadriver

Chapter 2 - physical layer (I)

Design interface automation test cases by hand: establish database instances and test case tables

!!** The test is valid * *:vscode "the terminal will be reused by the task, press any key to close" /vscode the terminal runs NPM to pop up the select program dialog box / try a new cross platform Pow

Make word2vec for Bert model
![Native JS implements login function, and local cookies save login information -- [call Netease cloud API interface] - super detailed explanation](/img/e0/1d5c87dc6c8b477a1668083dcdca0f.jpg)
Native JS implements login function, and local cookies save login information -- [call Netease cloud API interface] - super detailed explanation

Redis cluster deployment manual that Xiaobai can understand
随机推荐
LINQ extension methods - any() vs. where() vs. exists() - LINQ extension methods - any() vs. where() vs. exists()
Three versions realize black-and-white theme switching
CSDN's test teacher teaches JMeter to generate stress test reports
Installation of MySQL 8.0.19 under alicloud lightweight application server linux-centos7
CSDN is the only one: detailed tutorial teaching on how to connect multiple mobile phones by appium+pytest+allure+jenkins
Qt-7-multithreading
Blazor webassembly integrates Ocelot gateway to solve cross domain problems
Chart. JS 2.0 doughnut tooltip percentage - chart js 2.0 doughnut tooltip percentages
SSH based command operation
Declare war on uncivilized code II
English accumulation__ annoyance
Teach you how to design interface automation test cases: extract interface information and analyze it
Add SSL security certificate to web site
Make word2vec for Bert model
Postman testing websocket interface
使用api制作我的足迹地图
JS hand tear pen test questions ~ not sorted out
[graduation project recommendation] - personnel management system
How to unit test non pure functions -- unittest
How can an e-commerce system automatically cancel an order when it times out?