Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where to find C standard function prototypes easily

Tags:

c

linux

When coding C# in IDEs like Visual Studio, it is quite handy to "jump to definition or declarations". So that we know the prototypes/interfaces of functions/APIs easily.

Question: Is there an easy way to look up standard C functions prototypes? like a database or index of function declarations, or a website gives searching by function names, or a *NIX command?

Solutions that work/integrate within VIM are great.

If you are recommending download source code and then grep, could you give a grep command that returns more accurate results. Since the grep may return all lines that has the name of that function.

like image 969
Peng Zhang Avatar asked Oct 05 '14 14:10

Peng Zhang


People also ask

Are there function prototypes in C?

A function prototype is one of the most important features of C programming which was originated from C++. A function prototype is a declaration in the code that instructs the compiler about the data type of the function, arguments and parameter list.

Where within a program are function prototypes normally placed?

Function prototypes are often placed in separate header files, which are then included in the routines which need them. For example, "math. h" includes the function prototypes for the C math functions sqrt( ) and cos( ).

Where will you find the functions library?

Functions are available in a number of libraries. These are accessed by including header files in your code; the header file is a pointer/reference to the library. Library functions include standard input/output (stdio. h), string manipulation (string.

What is used to specify the prototype of a function in C?

D. Explanation: A function prototype in C or C++ is a declaration of a function that omits the function body but does specify the function's name, argument types and return type. While a function definition specifies what a function does, a function prototype can be thought of as specifying its interface.


1 Answers

*NIX command?

Yes, the command is man, for example man fopen. Type man man on the command line to read its manual page. If the same keyword has multiple meanings (and therefore multiple man pages), you may need to specify the right section number, i.e. man 3 time.

Solutions that work/integrate within VIM are great.

In vim, to view the man page for the word under cursor, press Shift+K.

like image 90
NPE Avatar answered Sep 18 '22 06:09

NPE