What are the types of function in c language?
1 answer(s)
In C, one can essentially think of two primary types of functions.
First, you have the library functions. These are already built for you. They are part of the standard C library. Think of common ones like printf()
or strlen()
. You do not write their code. You just include the proper header file to call upon them. They are very convenient for standard operations.
Then, you have the user-defined functions. These are the ones we, the programmers, create. We write them to perform a specific task, which helps keep our code clean and reusable.
Of course, one can also classify functions structurally, based on whether they accept arguments or return a value. But the main distinction is always library versus user-defined.