Computer Science Engineering (CSE) Exam  >  Computer Science Engineering (CSE) Questions  >  What does the following C-statement declare?i... Start Learning for Free
What does the following C-statement declare? 
int (*f) (int *);
  • a)
    A function that takes an integer pointer as argument and returns an integer
  • b)
    A function that takes an integer pointer as argument and returns an integer pointer
  • c)
    A pointer to a function that takes an integer pointer as argument and returns an integer
  • d)
    A function that takes an integer pointer as argument returns a function pointer
Correct answer is option 'C'. Can you explain this answer?
Verified Answer
What does the following C-statement declare?int (*f) (int *);a)A funct...
int (*f) (int*);
return type int, (*f) is a pointer to a function the argument is (int*) an integer pointer So, int (*f) (int*) means a pointer to a function that takes an integer pointer as an argument and returns an integer.
View all questions of this test
Most Upvoted Answer
What does the following C-statement declare?int (*f) (int *);a)A funct...
Explanation:

The given C statement is:

int (*f) (int *);

Let's break down the statement and understand its meaning:

int (*f) - This declares a pointer named 'f' to a function.

(int *) - This specifies that the function takes an integer pointer as an argument.

Therefore, the declaration int (*f) (int *) specifies that 'f' is a pointer to a function that takes an integer pointer as an argument.

Visual representation:

int (*f) (int *);

Here, 'f' is a pointer to a function.

Explanation of each option:

a) A function that takes an integer pointer as an argument and returns an integer:
This option is incorrect because the statement does not declare a function, but rather a pointer to a function.

b) A function that takes an integer pointer as an argument and returns an integer pointer:
This option is incorrect because the statement does not specify that the function returns an integer pointer, but rather an integer.

Correct answer:

c) A pointer to a function that takes an integer pointer as an argument and returns an integer:
This option is correct because the statement declares a pointer 'f' to a function that takes an integer pointer as an argument and returns an integer.

d) A function that takes an integer pointer as an argument returns a function pointer:
This option is incorrect because the statement does not declare a function that returns a function pointer, but rather a pointer to a function that returns an integer.

Summary:

The given C statement 'int (*f) (int *)' declares a pointer 'f' to a function that takes an integer pointer as an argument and returns an integer.
Explore Courses for Computer Science Engineering (CSE) exam

Similar Computer Science Engineering (CSE) Doubts

Top Courses for Computer Science Engineering (CSE)

What does the following C-statement declare?int (*f) (int *);a)A function that takes an integer pointer as argument and returns an integerb)A function that takes an integer pointer as argument and returns an integer pointerc)A pointer to a function that takes an integer pointer as argument and returns an integerd)A function that takes an integer pointer as argument returns a function pointerCorrect answer is option 'C'. Can you explain this answer?
Question Description
What does the following C-statement declare?int (*f) (int *);a)A function that takes an integer pointer as argument and returns an integerb)A function that takes an integer pointer as argument and returns an integer pointerc)A pointer to a function that takes an integer pointer as argument and returns an integerd)A function that takes an integer pointer as argument returns a function pointerCorrect answer is option 'C'. Can you explain this answer? for Computer Science Engineering (CSE) 2024 is part of Computer Science Engineering (CSE) preparation. The Question and answers have been prepared according to the Computer Science Engineering (CSE) exam syllabus. Information about What does the following C-statement declare?int (*f) (int *);a)A function that takes an integer pointer as argument and returns an integerb)A function that takes an integer pointer as argument and returns an integer pointerc)A pointer to a function that takes an integer pointer as argument and returns an integerd)A function that takes an integer pointer as argument returns a function pointerCorrect answer is option 'C'. Can you explain this answer? covers all topics & solutions for Computer Science Engineering (CSE) 2024 Exam. Find important definitions, questions, meanings, examples, exercises and tests below for What does the following C-statement declare?int (*f) (int *);a)A function that takes an integer pointer as argument and returns an integerb)A function that takes an integer pointer as argument and returns an integer pointerc)A pointer to a function that takes an integer pointer as argument and returns an integerd)A function that takes an integer pointer as argument returns a function pointerCorrect answer is option 'C'. Can you explain this answer?.
Solutions for What does the following C-statement declare?int (*f) (int *);a)A function that takes an integer pointer as argument and returns an integerb)A function that takes an integer pointer as argument and returns an integer pointerc)A pointer to a function that takes an integer pointer as argument and returns an integerd)A function that takes an integer pointer as argument returns a function pointerCorrect answer is option 'C'. Can you explain this answer? in English & in Hindi are available as part of our courses for Computer Science Engineering (CSE). Download more important topics, notes, lectures and mock test series for Computer Science Engineering (CSE) Exam by signing up for free.
Here you can find the meaning of What does the following C-statement declare?int (*f) (int *);a)A function that takes an integer pointer as argument and returns an integerb)A function that takes an integer pointer as argument and returns an integer pointerc)A pointer to a function that takes an integer pointer as argument and returns an integerd)A function that takes an integer pointer as argument returns a function pointerCorrect answer is option 'C'. Can you explain this answer? defined & explained in the simplest way possible. Besides giving the explanation of What does the following C-statement declare?int (*f) (int *);a)A function that takes an integer pointer as argument and returns an integerb)A function that takes an integer pointer as argument and returns an integer pointerc)A pointer to a function that takes an integer pointer as argument and returns an integerd)A function that takes an integer pointer as argument returns a function pointerCorrect answer is option 'C'. Can you explain this answer?, a detailed solution for What does the following C-statement declare?int (*f) (int *);a)A function that takes an integer pointer as argument and returns an integerb)A function that takes an integer pointer as argument and returns an integer pointerc)A pointer to a function that takes an integer pointer as argument and returns an integerd)A function that takes an integer pointer as argument returns a function pointerCorrect answer is option 'C'. Can you explain this answer? has been provided alongside types of What does the following C-statement declare?int (*f) (int *);a)A function that takes an integer pointer as argument and returns an integerb)A function that takes an integer pointer as argument and returns an integer pointerc)A pointer to a function that takes an integer pointer as argument and returns an integerd)A function that takes an integer pointer as argument returns a function pointerCorrect answer is option 'C'. Can you explain this answer? theory, EduRev gives you an ample number of questions to practice What does the following C-statement declare?int (*f) (int *);a)A function that takes an integer pointer as argument and returns an integerb)A function that takes an integer pointer as argument and returns an integer pointerc)A pointer to a function that takes an integer pointer as argument and returns an integerd)A function that takes an integer pointer as argument returns a function pointerCorrect answer is option 'C'. Can you explain this answer? tests, examples and also practice Computer Science Engineering (CSE) tests.
Explore Courses for Computer Science Engineering (CSE) exam

Top Courses for Computer Science Engineering (CSE)

Explore Courses
Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev