Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C function declaration

Tags:

c

function

can we declare a function in a header file in following way?

extern int ap( char[][] );

can we use char[][] in function?

like image 235
ambika Avatar asked Mar 03 '10 04:03

ambika


People also ask

What is function declaration in C?

A function declaration tells the compiler about a function's name, return type, and parameters. A function definition provides the actual body of the function. The C standard library provides numerous built-in functions that your program can call.

How is function declared in C example?

A function consist of two parts: Declaration: the function's name, return type, and parameters (if any) Definition: the body of the function (code to be executed)

Does C require function declaration?

Actually, it is not required that a function be declared before use in C. If it encounters an attempt to call a function, the compiler will assume a variable argument list and that the function returns int.

What is the function declaration?

The function declaration (function statement) defines a function with the specified parameters. You can also define functions using the Function constructor and a function expression.


1 Answers

No, you need to specify the last N-1 dimensions for an array.

extern int ap( char[][DIMENSION] );

For more information look here

like image 149
Lombo Avatar answered Oct 09 '22 18:10

Lombo