---
title: "Interpret pointer declarations"
subject: "Computer Programming"
chapter: 9
key: "semester_1/computer_programming:pointer-definitions-declarations"
source: https://www.bctengineer.com/q/semester_1/computer_programming/pointer-definitions-declarations
site: BCT Engineering
---

# Interpret pointer declarations

Computer Programming · Chapter 9: Pointers

- Asked in: 2074 Chaitra, 5 marks
- Video: [Interpreting Complex Declaration | How to read complex declaration in C / C++ ?](https://www.youtube.com/watch?v=6GiBCeGbDhs) — Computer Shastra
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_1/computer_programming/pointer-definitions-declarations
- Whole chapter: https://www.bctengineer.com/md/semester_1/computer_programming/chapter-9

## Question

Define following term:
i) int*p;
ii) int p(char*a)
iii) int(*p(char*a))
iv) int *p(void)
v) int*(*p[10])char a)

## Short answer

i) p is a pointer to int. ii) p is a function taking char* returning int. iii) p is a function taking char* returning int*. iv) p is a function taking void returning int*. v) p is an array of 10 pointers to functions taking char returning int*.

## Answer

(The last declaration is written as `int *(*p[10])(char a)`, assuming the missing brackets.)

| Declaration | Meaning |
|---|---|
| i) `int *p;` | `p` is a pointer to an integer |
| ii) `int p(char *a)` | `p` is a function taking a pointer to char and returning an int |
| iii) `int (*p(char *a))` | The brackets are redundant: same as `int *p(char *a)`. `p` is a function taking a pointer to char and returning a pointer to int |
| iv) `int *p(void)` | `p` is a function with no arguments returning a pointer to int |
| v) `int *(*p[10])(char a)` | `p` is an array of 10 pointers to functions, each taking a char and returning a pointer to int |

**How to read:** start at the name, go right (`[]` or `()`), then left (`*`), and use brackets to change the order. For (v): `p[10]` is an array of 10, `*` makes them pointers, `(char a)` makes them pointers to functions, and `int *` is the return type.

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. What does int *p; declare?
   A. An integer named p
   B. A pointer to an integer
   C. A function returning int
   D. An array of integers
   Answer: B. The star makes p a pointer that holds the address of an int. (Key point: int *p;)

2. What does int *p(void) declare?
   A. A pointer to a function returning int
   B. A function with no arguments returning a pointer to int
   C. A pointer to void
   D. An int variable
   Answer: B. The parentheses bind first to p, making it a function; the int * is its return type. (Key point: int *p(void))

3. How is int (*p(char *a)) read?
   A. Pointer to a function returning int
   B. Same as int *p(char *a): a function taking char pointer and returning pointer to int
   C. Array of pointers
   D. Same as int p(char *a)
   Answer: B. The brackets are redundant, so it is a function returning a pointer to int. (Key point: Redundant brackets)

4. What is int *(*p[10])(char a)?
   A. Pointer to an array of 10 functions
   B. A function returning an array of 10 pointers
   C. An array of 10 pointers to functions taking a char and returning a pointer to int
   D. An array of 10 int pointers
   Answer: C. p[10] is an array, * makes each element a pointer, (char a) makes them pointers to functions, and int * is the return type. (Key point: Array of function pointers)

## Related in Computer Programming

- [Series 1×10+3×20+6×30+…](https://www.bctengineer.com/question.md?key=semester_1%2Fcomputer_programming%3Aseries-1x10-3x20) — Computer Programming, chapter 5
- [Correct program: character arrays](https://www.bctengineer.com/question.md?key=semester_1%2Fcomputer_programming%3Acorrect-program-char-arrays) — Computer Programming, chapter 7
- [Correct program: do-while and pow](https://www.bctengineer.com/question.md?key=semester_1%2Fcomputer_programming%3Acorrect-program-sum-root) — Computer Programming, chapter 3
- [Correct program: Celsius to Fahrenheit](https://www.bctengineer.com/question.md?key=semester_1%2Fcomputer_programming%3Acorrect-program-celsius-fahrenheit) — Computer Programming, chapter 3
- [Correct program: case array and average](https://www.bctengineer.com/question.md?key=semester_1%2Fcomputer_programming%3Acorrect-program-case-array) — Computer Programming, chapter 3

## Related in other subjects

- [Sensitivity in 10% steps; interpret](https://www.bctengineer.com/question.md?key=semester_6%2Fengineering_economics%3Asensitivity-30-step-10-20000) — Engineering Economics, chapter 6
- [Sensitivity on investment, revenue and life; interpret](https://www.bctengineer.com/question.md?key=semester_6%2Fengineering_economics%3Asensitivity-30-initial-100000-useful-10) — Engineering Economics, chapter 6
- [RMR class IV support and excavation](https://www.bctengineer.com/question.md?key=semester_4%2Fengineering_geology_ii%3Armr-class-iv-support) — Engineering Geology II, chapter 6, asked 6×
- [Internal discharge in disc with 0.01 mm void](https://www.bctengineer.com/question.md?key=semester_8%2Fhigh_voltage_engineering%3Ainternal-discharge-disc-0-01mm) — High Voltage Engineering, chapter 6, asked 3×
