The Gateway to Computer Science Excellence
+2 votes
620 views

Consider the following two function declarations:

int *f()

int (*f)()

Which of the following is true?

  1. Both are identical
  2. The first is a correct declaration and the second is wrong
  3. Both are different ways of declaring pointer to a function
  4. The first declaration is a function returning a pointer to an integer and the second is a pointer to function returning integer
in Programming and DS by Veteran (105k points)
recategorized by | 620 views

1 Answer

+1 vote
ans is D

int *f( ) is a function returning a pointer to an integer  (here priority of () is more than * so it written first

int (*f)() here since both are braces so we will proceed from left to right so it is pointer to function returning integer
by Boss (49.3k points)
Answer:

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,741 questions
57,251 answers
198,050 comments
104,676 users