Download CBSE Class 12 Computer Science Assignments
Access comprehensive school assignments for Pointers Concepts using the CBSE Class 12 Computer Science Pointers Concepts. Designed to align with the 2026-27 CBSE academic guidelines, these practice sets help Class 12 Computer Science students reinforce core concepts and improve their problem-solving accuracy.
Access CBSE School Assignments and Answers
View or download the dedicated CBSE Class 12 Computer Science Pointers Concepts resource below. Engaging with these assignments under focused study conditions ensures continuous academic progress and mastery of the 2026-27 curriculum.
Question 1. How is *p different from **p ?
Answer: *p is a pointer pointing to a normal memory location storing a value. But **p is a pointer-to-pointer (double pointer), which means it points to another pointer variable, which in turn points to a memory location storing a value.
In simple words: *p holds a value's address, while **p holds the address of another pointer.
Exam Tip: Remember that each asterisk (*) adds one level of indirection when dereferencing pointers.
Question 2. How is &p different from *p ?
Answer: &p is the address-of operator applied to pointer p, which gives the memory address where the pointer variable p itself is stored. On the other hand, *p is the dereference operator applied to p, which accesses the value stored at the memory address currently held by p.
In simple words: &p gives the address of the pointer variable, while *p gives the value at the address the pointer points to.
Exam Tip: & is used to get references or addresses, whereas * is used to declare pointers or dereference them.
Question 3. Find the error in following code segment :
Float **p1, p2;
P2 = &p1;
Answer: In the code segment, p1 is declared as a pointer to a pointer (float **), meaning it can store the address of another pointer variable. However, p2 is declared as a simple pointer (float *p2 because the data type specifier only applies to the first variable unless repeated), which can only store the address of a normal float variable. Attempting to assign the address of a pointer-to-pointer (&p1) to a simple pointer p2 causes a type mismatch error.
In simple words: A simple pointer cannot store the address of a double pointer.
Exam Tip: Always check pointer levels carefully; assigning &p1 requires a variable of type float **.
Question 4. What will be the output of the following code segment ?
char C1 = 'A';
char C2 = 'D';
char *i, *j;
i = &C1;
j = &C2;
*i = j;
cout << C1;
Answer: The code attempts to assign a pointer variable j (an address) to the memory location pointed to by character pointer i (*i = j). This results in a type mismatch compilation error in standard C++ because you cannot assign a pointer type (char *) to a character value (*i). If treated conceptually as a strict compile-time error, the code fails to compile. Assuming it compiles with a warning or type cast, it attempts to store an address byte into C1.
In simple words: Assigning a pointer directly to a dereferenced char pointer causes a type mismatch error.
Question 5. How does C++ organize memory when a program is run ?
Answer: Once a program is compiled and executed, C++ divides the available memory into four logically distinct regions:
1. Program Code Area: Stores the compiled machine instructions of the program.
2. Global Data Area: Stores global and static variables that persist throughout the program execution.
3. Stack Area: Manages function call frames, holding return addresses, passed arguments, local variables, and the current CPU state.
4. Heap Area (Free Store): A pool of dynamic memory used for runtime allocation via new and delete operators.
In simple words: C++ organizes memory into code, global variables, stack, and heap regions.
Exam Tip: Memorize these four memory segments as they are frequently asked in board exams under memory management.
Question 6. Identify and explain the error(s) in the following code segment :
float a[] = { 11.02, 12.13, 19.11, 17.41};
float *j, *k;
j = a;
k = a + 4;
j = j * 2;
k = k / 2;
cout << " *j = " << *j << ", *k = " << *k << "\n";
Answer: The erroneous statements in the code are:
j = j * 2;
k = k / 2;
Explanation: Multiplication and division arithmetic operations cannot be performed directly on pointer variables. Only addition and subtraction of integers (pointer arithmetic) are valid on pointers.
In simple words: You cannot multiply or divide pointer addresses.
Exam Tip: Only addition (+) and subtraction (-) are permitted between pointers and integer offsets.
Question 7. How does the functioning of a function differ when (i) an object is passed by value ? (ii) an object is passed by reference ?
Answer:
(i) When an object is passed by value, the called function creates a distinct local copy of the object by invoking its copy constructor. Any modifications made to the object inside the function affect only the local copy. Upon function termination, the destructor is automatically invoked to destroy this temporary copy.
(ii) When an object is passed by reference, the called function does not create a copy. Instead, it operates directly on the original object via its reference alias. No constructor or destructor is invoked during this process.
In simple words: Pass by value creates a temporary copy using constructors/destructors, while pass by reference works directly on the original object without copies.
Exam Tip: Always mention copy constructors and destructors when explaining pass-by-value for objects.
2 MARKS PRACTICE QUESTIONS
Question 1. Differentiate between static and dynamic allocation of memory.
Answer:
1. Static Memory Allocation: Memory size is fixed and known at compile-time. It is allocated on the stack or global data area (e.g., int a;). It cannot be resized during runtime.
2. Dynamic Memory Allocation: Memory is allocated dynamically during runtime using operators like new from the heap pool (e.g., int *p = new int;). Its size can be determined and adjusted during execution.
In simple words: Static allocation happens at compile-time with fixed sizes, while dynamic allocation happens at runtime using the heap.
Exam Tip: Highlight compile-time vs runtime and stack/global vs heap in your distinction.
Question 2. Identify and explain the error in the following program :
#include<iostream.h>
int main()
{
int x[] = { 1, 2, 3, 4, 5 };
for (int i = 0; i < 5; i++)
{
cout << *x;
x++;
}
return 0;
}
Answer: The error is in the statement x++; inside the loop. The array identifier x is a constant pointer representing the base address of the array, and its value cannot be modified or incremented. Therefore, x++ results in a lvalue required for increment/decrement error.
In simple words: Array names are constant pointers and cannot be incremented using ++.
Exam Tip: Use a separate pointer variable (like int *p = x;) to traverse arrays if incrementing is necessary.
Question 3. Give the output of the following :
char *s = "computer";
for (int x = strlen(s) - 1; x >= 0; x--)
{
for(int y = 0; y <= x; y++)
cout << s[y];
cout << endl;
}
Answer:
computer
compute
comput
compu
comp
com
co
c
In simple words: It prints substrings of 'computer' starting from the full word down to the single first character 'c'.
Exam Tip: Trace nested loops carefully by substituting outer loop values of x from 7 down to 0.
Question 4. Identify the syntax error(s), if any, in the following program. Also give reason for errors.
void main()
{
const int i = 20;
const int * const ptr = &i;
(*ptr++; int j= 15; ptr = &j;)
}
Answer: Errors in the code block:
1. (*ptr++): ptr is a constant pointer to a constant integer (const int * const). Therefore, its contents cannot be modified via dereferencing, and the pointer address itself cannot be incremented.
2. ptr = &j;: ptr is declared as a const pointer, so its address cannot be modified to point to another variable like j.
In simple words: You cannot modify the value or the address of a constant pointer-to-constant.
Exam Tip: Pay close attention to const qualifiers placed before and after the asterisk in pointer declarations.
Question 5. What is 'this' pointer ? What is its significance ?
Answer: The this pointer is an implicit pointer passed automatically to every non-static member function when it is invoked. It holds the memory address of the specific object that called the member function.
Significance: It allows member functions to access and manipulate the data members of the invoking object explicitly or implicitly, distinguishing which object's data members should be modified when multiple objects share the same member function code.
In simple words: 'this' is a built-in pointer that tells a member function which object called it.
Exam Tip: Note that static member functions and friend functions do not have a this pointer.
Question 6. What will be the output of following program ?
#include<iostream.h>
void main()
{
char name1[] = "ankur";
char name2[] = "ankur";
if (name1 != name2)
cout << "\n both the strings are not equal";
else
cout << "\n the strings are equal";
}
Answer:
both the strings are not equal
Explanation: name1 and name2 are two separate character arrays allocated at different memory locations. Comparing them using != compares their base memory addresses, not their string contents, so the condition evaluates to true.
In simple words: Comparing two array names compares their memory addresses, not their letter contents, so they are considered unequal.
Exam Tip: Use strcmp() from string.h to compare string contents in C++ rather than comparing array pointer names directly.
Question 7. Give and explain the output of the following code :
void junk (int, int *);
int main() {
int i = 6, j = -4;
junk (i, &j);
cout << "i = " << i << ", j = " << j << "\n";
return 0;
}
void junk(int a, int *b)
{
a = a * a;
*b = *b * *b;
}
Answer:
i = 6, j = 16
Explanation: Parameter i is passed by value, so local modifications to a inside junk() do not affect the main variable i (which remains 6). Parameter j is passed by address (pointer), so modifying *b directly updates the value of j in main() to \((-4) \times (-4) = 16\).
In simple words: Pass by value leaves 'i' unchanged, while pass by pointer updates 'j' to its square.
Exam Tip: Distinguish clearly between call-by-value parameters and call-by-address parameters when tracing outputs.
Free study material for Computer Science
Pointers Concepts Printable Assignments & Solutions for Class 12 Computer Science
Class 12 Computer Science Pointers Concepts Printable Assignments
Explore reliable practice questions for Pointers Concepts tailored for Class 12 learners. Use these structured worksheets to evaluate preparedness and strengthen core problem-solving skills.
Maximize Exam Scores with Chapter Practice Sets
- Syllabus Compliance: Sets reflect current CBSE evaluation criteria and official marking frameworks.
- Multi-Format Practice: Includes varied problem types designed to deepen comprehension across all sub-topics.
- Time Management: Routine practice optimizes pacing to finish school examinations comfortably within schedule.
How to Approach Computer Science Pointers Concepts Assignments
- Initial Reading: Begin by reading the NCERT book for Class 12 Computer Science to build a baseline understanding.
- Independent Testing: Attempt assignment questions unassisted, then verify work using provided answer keys.
- Supplementary Aids: Leverage revision notes and worksheets whenever you encounter difficult topics.
FAQs
You can download free PDF assignments for Class 12 Computer Science Pointers Concepts from StudiesToday.com. These practice sheets have been updated for the 2026-27 session covering all concepts from latest NCERT textbook.
Yes, our teachers have given solutions for all questions in the Class 12 Computer Science Pointers Concepts assignments. This will help you to understand step-by-step methodology to get full marks in school tests and exams.
Yes. These assignments are designed as per the latest CBSE syllabus for 2026. We have included huge variety of question formats such as MCQs, Case-study based questions and important diagram-based problems found in Pointers Concepts.
Practicing topicw wise assignments will help Class 12 students understand every sub-topic of Pointers Concepts. Daily practice will improve speed, accuracy and answering competency-based questions.
Yes, all printable assignments for Class 12 Computer Science Pointers Concepts are available for free download in mobile-friendly PDF format.