![]() ![]() The argument is taken to be 0 to indicate normal execution and if some other value is used then that's value is used to show some kind of error. Note that the "returning_value" is returned to the calling process, it means mostly it will return to the operating system. Here the example we will be considering the example of is graphic card is present or not because graphic card is must for running high end games. #Another word for running a program code#Now let's look at a pseudo code to identify when we actually use a exit() statement during normal execution of our program. The general prototype of the exit() is :- void exit(int returning_value) This function immediately interrupts and closes the current program in execution. This function forces forcefully termination of the current program and the control is transferred to the Operating system. This function doesn't affect the control flow rather it exits the / closes the current program in execution. It should be noted that this exit() function is not a program control statement used in C programs like break/goto/continue. This function requires the declaration of the C library stdlib.h in which it is defined.Īnd to use this function in C++ we may have to include the C++ library cstdlib. We will, now, go through each of the above methods in detail. Some of the common ways to terminate a program in C are: Starting with the most widely used and most obvious function that is by using the exit() function. In this article, we are going to learn about various methods by which we can terminate a C program which is currently in execution. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |