Skip to study material

PROGRAMMING FOR PROBLEM SOLVING

Unit V · Pointers and Strings

AR25I Year · I Semester2025–2026

Understand pointers, memory and strings through clear explanations and tested examples.

24 topics24 two-mark questions24 five-mark questions5 diagrams and flowcharts21 C programs

48 questions

Open complete unit for printing / PDF

Pointer Basics

  1. 01What is a pointer?2 marks
  2. 02Define a pointer and explain the address and dereference operators.5 marks
  3. 03Can a null pointer be dereferenced?2 marks
  4. 04Explain pointer types, void pointers and null pointers.5 marks

Pointers and Functions

  1. 05Does passing a pointer change C into pass by reference?2 marks
  2. 06Explain how pointer arguments allow a function to modify caller data.5 marks
  3. 07What does int **pp mean?2 marks
  4. 08Explain pointers to pointers with an example.5 marks
  5. 09What does int (*operation)(int, int) declare?2 marks
  6. 10Explain function pointers and callback-style use.5 marks

Pointers and Arrays

  1. 11What does an array expression usually become in an expression?2 marks
  2. 12Explain the relationship between pointers and one-dimensional arrays.5 marks
  3. 13How far does p + 1 move an int pointer within an array?2 marks
  4. 14Explain valid pointer arithmetic and pointer subtraction.5 marks
  5. 15What does const char *names[3] declare?2 marks
  6. 16Explain an array of pointers with a string example.5 marks
  7. 17What pointer type matches the first row of int a[2][3]?2 marks
  8. 18Explain pointers to rows of a two-dimensional array.5 marks

Dynamic Memory

  1. 19Which header declares malloc, calloc, realloc and free?2 marks
  2. 20Explain dynamic memory allocation and its main functions.5 marks
  3. 21How do malloc and calloc differ in initialisation?2 marks
  4. 22Compare malloc and calloc with a complete example.5 marks
  5. 23Why store realloc’s result in a temporary pointer?2 marks
  6. 24Explain safe use of realloc and free with an example.5 marks
  7. 25Distinguish a dangling pointer and a memory leak.2 marks
  8. 26Explain uninitialised pointers, dangling pointers and memory leaks.5 marks

String Basics

  1. 27What marks the end of a C string?2 marks
  2. 28Explain C strings, null termination and character arrays.5 marks
  3. 29Why is fgets useful for reading a line with spaces?2 marks
  4. 30Explain whole-line string input using fgets and safe newline handling.5 marks
  5. 31Why use const char * for a function that only reads a string?2 marks
  6. 32Explain character pointers and const string parameters in functions.5 marks

String Operations

  1. 33Name four standard string functions and their purposes.2 marks
  2. 34Explain the main string library functions and their precautions.5 marks
  3. 35Why is destination = source not an array-content copy in C?2 marks
  4. 36Explain string initialisation, pointer assignment and copying into a character array.5 marks
  5. 37What bounds must a substring request satisfy?2 marks
  6. 38Write a C function to extract a substring from a given position.5 marks
  7. 39How much capacity is needed to concatenate strings of lengths m and n?2 marks
  8. 40Explain string concatenation with a capacity-checked example.5 marks
  9. 41What do the signs of strcmp’s result mean?2 marks
  10. 42Explain string comparison using strcmp and why == is unsuitable for contents.5 marks
  11. 43Does a string length include the null terminator?2 marks
  12. 44Write a function to find a string’s length without strlen.5 marks

Substring Editing

  1. 45What must be moved when inserting text into a string?2 marks
  2. 46Write a function to insert a substring at a given string position.5 marks
  3. 47How can a substring be deleted in place?2 marks
  4. 48Write a function to delete n characters from a given string position.5 marks

The 2- and 5-mark badges are practice allocations. Previous-paper questions retain their printed marks.