Run System Routines And Subroutines Through Program Without Messing Up With Third-party Binaries And Executables

Asked By 0 points N/A Posted on -
qa-featured

How can we run system routines and subroutines through another program without messing up with third-party binaries and executables?

SHARE
Answered By 40 points N/A #319180

Run System Routines And Subroutines Through Program Without Messing Up With Third-party Binaries And Executables

qa-featured

We can easily call system functions and subroutines through a C program without indulging with any other binaries or batch scripts. In C, there is a header file called the standard library. This file contains prototypes of the functions required to call OS utilities and subroutines.

Let’s take the example of turning off the system. You might be thinking that we might need to install sophisticated APIs for this, but you would be surprised to know that we can do that by simply calling the terminal commands through a library function of the header file “stdlib.h”.

Below is the screenshot the code that works perfectly fine for calling system utilities.

Compile the code and run it. On execution, you will get a result like:

Related Questions