retagged by
21,184 views
39 votes
39 votes

What does the following C-statement declare?

int (*f) (int * );
  1. A function that takes an integer pointer as argument and returns an integer

  2. A function that takes an integer as argument and returns an integer pointer

  3. A pointer to a function that takes an integer pointer as argument and returns an integer

  4. A function that takes an integer pointer as argument and returns a function pointer

retagged by

5 Answers

Best answer
58 votes
58 votes
  1. A function that takes an integer pointer as argument and returns an integer $\Rightarrow int \ f (int *)$

  2. A function that takes an integer as argument and returns an integer pointer $\Rightarrow int * f (int )$

  3. A pointer to a function that takes an integer pointer as argument and returns an integer $\Rightarrow$

    int (*f) (int * );

So, answer is C.

edited by
Answer:

Related questions

16.9k
views
8 answers
52 votes
Kathleen asked Sep 22, 2014
16,899 views
Consider the following C program:double foo (double); /* Line 1 */ int main() { double da, db; //input da db = foo( ... to unintended resultssome compiler-warnings due to type-mismatch eventually leading to unintended resultscompiler errors
15.2k
views
5 answers
30 votes
Kathleen asked Sep 18, 2014
15,245 views
Consider the following functionvoid swap(int a, int b) { int temp; temp = a; a = b; b = temp; }In order to exchange the values of two variables $x$ and ... return any value$swap (x, y)$ cannot be used as the parameters are passed by value
31.6k
views
5 answers
71 votes
Kathleen asked Sep 22, 2014
31,571 views
The relation book (title, price) contains the titles and prices of different books. Assuming that no two books have the same price, what does ... inexpensive bookTitle of the fifth most expensive bookTitles of the five most expensive books
18.0k
views
6 answers
64 votes
go_editor asked Sep 26, 2014
18,006 views
Consider the following program in C language:#include <stdio.h> main() { int i; int*pi = &i; scanf("%d",pi); printf("%d\n", i+5); }Which one of ... of variable $i$.On execution, the value printed is $5$ more than the integer value entered.