Given a function, let’s say atoi, how can I find the header file I should include if I want to use this function ? I’m always get puzzled for that issue. If let me treat function like “atoi” as linux c api, I can put my question in another way as : Is a document for linux c api ?
Share
Man pages. Type
man atoi(or, in general,man <function>) at your command prompt. It will give you usage information as well as a listing of which headers to include.Man pages also document programs and commands (find, grep, cd, etc.). Sometimes you may run into a case where a program has the same name as a C function (e.g. write). In that case, you need to direct man to look in the correct section of the manual, section 2 for system calls and section 3 for library functions. You do this by inserting the section number between “man” and the command name:
man 2 write. If you do not know whether a given function is a system call or a library function, try both.You can learn more about manual pages by typing
man man.