C Programming - Typedef - Discussion

Discussion Forum : Typedef - General Questions (Q.No. 3)
3.
What is x in the following program?
#include<stdio.h>

int main()
{
    typedef char (*(*arrfptr[3])())[10];
    arrfptr x;
    return 0;
}
x is a pointer
x is an array of three pointer
x is an array of three function pointers
Error in x declaration
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
14 comments Page 2 of 2.

Varshini said:   6 years ago
Then what about [10], is it same as [3]?

Ram said:   5 years ago
What is the difference between an array of three-pointers and array of three function pointers?

Please tell me.

Ankit said:   5 years ago
Array of three pointers means an array will contain three ponters which will points to three address space.

Array of three function pointers it means an array of size 3 which can stores the address of three functions.

Dev said:   3 years ago
Can anyone explain the program for understanding?

Because I understand x is an array of 3 function pointers, but I don't know how to implement it?


Post your comments here:

Your comments will be displayed after verification.