Explain the meaning of each of the following functions prototypes and mention the return data type of each of them: 10m Jun2006

By | June 13, 2014

Explain the meaning of each of the following functions prototypes and mention the return data type of each of them: 10m Jun2006

 

(i) double f(double a, int b);  –   This function has two arguments, first of double data type and second of int data type. The return data type is double.

 

(ii) void f(long a, short b, unsigned c); );  –   This function has three arguments, first of long data type, second of short data type and third of unsigned data type. The return data type is void. (i.e. this function will not return anything)

 

(iii) unsigned f(unsigned a, unsigned b); –   This function has two arguments, first of unsigned data type and second of unsigned data type. The return data type is unsigned.

 

(iv) int (*f) (char*, int); –   This function has two arguments, first of char* data type (i.e. character pointer) and second of int data type. The return data type is int. (i.e. integer pointer)

 

(v) int * f(char*, int); –   This function has two arguments, first of char* data type (i.e. character pointer) and second of int data type. The return data type is int. (i.e. integer pointer)

Leave a Reply