TomoLink
TCS NQT GuideTCS NQT Programming Logic & CS FundamentalsPointers and Memory Management MCQ Questions

Pointers and Memory Management MCQ Questions

Learn core concepts, essential formulas, and attempt practice questions designed on the latest TCS NQT testing patterns.

Key Concepts & Formulas

  • 1Pointer holds the memory address of a variable.
  • 2'*' operator dereferences pointer (reads value at address).
  • 3'&' operator returns address of variable.
  • 4Pointer size is independent of data type (usually 4 bytes on 32-bit, 8 bytes on 64-bit).

TCS NQT Style Practice Questions

Practice Question 1

What is output of: int a=5; int *p=&a; *p=10; printf("%d", a);

A) 10
B) 5
C) Address of a
D) Error

Correct Answer: A) 10

Step-by-step Solution: p points to a. *p = 10 modifies the value at the address of a, changing a to 10.

Practice Question 2

If double *d is declared on a 64-bit machine, what is sizeof(d)?

A) 8 bytes
B) 4 bytes
C) 16 bytes
D) 1 byte

Correct Answer: A) 8 bytes

Step-by-step Solution: On 64-bit systems, all pointers are 8 bytes, regardless of whether they point to char, int, or double.

Study Pro-Tip

A pointer declaration double *p does not allocate a double in memory, just an address storage box.