Friday, July 31, 2009

What is user defined function and inbuilt functions in C?

PLEASE TELL IT AS EARLY AS POSSIBLY. MAY BE TODAY ONLY

What is user defined function and inbuilt functions in C?
When you install a C compiler for a chip/operating system, there are going to be a bunch of inbuilt (or more commonly called built-in or system functions). The will be described (but not defined) in header files. Search the compiler folder and subfolders for *.h and you will see a lot of them. Open math.h (in read-only mode please) an you can scroll down and see some like sin(), cos(), tan().





User defined functions are functions that you create. For example:


----


#include %26lt;stdio.h%26gt;





void main()


{


printf("%d\n",add(3));


}





int add(int i, int j)


{


return i+j;


}


----


In this case add() is a user defined function. While printf() is a built-in function. You wrote add() but you did not write printf()





I'm assuming you will pick a "Best Answer" today as well. :)


No comments:

Post a Comment