search
Log In
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
Welcome to GATE CSE Doubts, where you can ask questions and receive answers from other members of the community.
1 vote
23 views
What does the following function declare

 int *(*p)(char (*a) []);

A)p is a pointer to a function that takes an argument as pointer and returns an integer.

B) p is a pointer to a function takes an argument as pointer to a character and returns a pointer integer.

C)  p is a pointer to a function  that takes an argument as array of pointers to characters and returns a pointer to an integer.

D) None of these.
in Programming 15 points 23 views
0

B is right and it should be character array

0
@ palash  Yadav

Ans - option (B)

What are predence of  [] and () .?
0

https://en.cppreference.com/w/c/language/operator_precedence i think both have same precedence.i might have made a mistake,the argument one is pointer to array

0
DKY123 ,i think option (B) should be character array not character,then it is right
0
@Palash Yadav

Why Option (C) is Wrong?

Why not consider [] .
0
@Palash Yadav

Thank you for clear my  doubt .

Your approach is right .

I choosed Option (C) but my answer is wrong.

Given correct answer is Option (B).

1 Answer

1 vote
 
Best answer

https://www.geeksforgeeks.org/difference-between-pointer-to-an-array-and-array-of-pointers/#:~:text=%E2%80%9CArray%20of%20pointers%E2%80%9D%20is%20an,Syntax%3A&text=We%20can%20make%20separate%20pointer,point%20to%20all%20the%20values. if you are finding difficulty in solving that i have edited my answer on why b is right or you can look at the article,,,,option c is wrong because it mention array of pointers as argument which is wrong it is pointer to a character array

135 points
selected by
...