CBSE Class 12 Computer Science Pointer Worksheet

Read and download free pdf of CBSE Class 12 Computer Science Pointer Worksheet. Students and teachers of Class 12 Computer Science can get free printable Worksheets for Class 12 Computer Science Pointer in PDF format prepared as per the latest syllabus and examination pattern in your schools. Class 12 students should practice questions and answers given here for Computer Science in Class 12 which will help them to improve your knowledge of all important chapters and its topics. Students should also download free pdf of Class 12 Computer Science Worksheets prepared by school teachers as per the latest NCERT, CBSE, KVS books and syllabus issued this academic year and solve important problems with solutions on daily basis to get more score in school exams and tests

Worksheet for Class 12 Computer Science Pointer

Class 12 Computer Science students should refer to the following printable worksheet in Pdf for Pointer in Class 12. This test paper with questions and answers for Class 12 will be very useful for exams and help you to score good marks

Class 12 Computer Science Worksheet for Pointer

POINTERS Pointers :

- Pointer is a variable that holds a memory address of another variable.

- It supports dynamic allocation routines.

- It can improve the efficiency of certain routines. C++ Memory Map :

- Program Code : It holds the compiled code of the program.

- Global Variables : They remain in the memory as long as program continues.

- Stack : It is used for holding return addresses at function calls, arguments passed to the functions, local variables for functions. It also stores the current state of the CPU.

- Heap : It is a region of free memory from which chunks of memory are allocated via DMA functions.

Static Memory Allocation : The amount of memory to be allocated is known in advance and it allocated during compilation, it is referred to as Static Memory Allocation.

Eg. Int a; // This will allocate 2 bytes for a during compilation. Dynamic Memory Allocation : The amount of memory to be allocated is not known beforehand rather it is required to allocated as and when required during runtime, it is referred to as dynamic memory allocation.

C++ offers two operator for DMA – new and delete

Q) Find the output of the following program:
#include<iostream.h>
void main()
{ int Array[]={4,6,10,12};
int *pointer=Array;
for(int I=1;I<=3;I++)
{ cout<<*pointer<<”#”;
pointer++;
}
cout<<endl;
for(I=1;I<=4;I++)
{ (*pointer)*=3;
--pointer;
}
for(I=1;I<5;I++)
cout<<Array[I-1]<<”@”;
cout<<endl;
}

Q) Find the output of the following program:
#include<iostream.h>
void main( )
{ int Numbers[]={2,4,8,10};
int *ptr=Numbers;
for(int C=1;C<3;C++)
{ cout<<*ptr<<”@”;
ptr++;
}
cout<<endl;
for(C=0;C<4;C++)
{ (*ptr)*=2;
--ptr;
}
for(C=0;C<4;C++)
cout<<Numbers[C]<<”#”;
cout<<endl; }

Q) Find the output of the following program:
#include<iostream.h>
#include<string.h>
class state
{ char *state_name;
int size;
public:
state( )
{ size=0;
state_name=new char[size+1];
}
state(char *s)
{ size=strlen(s);
state_name=new char[size+1];
strcpy(state_name,s);
}
void display( )
{ cout<<state_name<<endl;
}
void Replace(state &a, state &b)
{ size=a.size+b.size;
delete state_name;
state_name=new char[size+1];
strcpy(state_name,a.state_name);
strcat(state_name,b.state_name);
}
};
void main( )
{ char *temp=”Delhi”;
state
state1(temp),state2(“Mumbai”),state3(“Nagpur”),S1,S2;
S1.Replace(state1,state2);
S2.Replace(S1,state3);
S1.display( );
S2.display( );}

Q) Find the output of the following program:
#include<iostream.h>
#include<string.h>
class student
{ char *name;
int I;
public:
student( )
{ I=0;
name=new char[I+1];
}
student(char *s) { I=strlen(s);
name=new char[I+1];
strcpy(name,s); }
void display( )
{ cout<<name<<endl; }
void manipulate(student &a, student &b)
{
I=a.I+b.I;
delete name;
name=new char[I+1];
strcpy(name,a.name);
strcat(name,b.name);
}
};
void main( )
{ char *temp=”Jack”;
Student name1(temp),name2(“Jill”),name3 (“John”) ,S1,S2;
S1.manipulate(name1,name2);
S2.manipulate(S1,name3);
S1.display( );S2.display( ); }

Q) What is “this” pointer? Give an example to illustrate the use of it in C++.
Answer:
A special pointer known as this pointer stores the address of the object that is currently invoking a member function. The this pointer is implicitly passed to the member functions of a class whenever they are invoked. (As soon as you define a class, the member functions are created and placed in the memory space only once.
That is, only one copy of member functions is maintained that is shared by all the objects of the class. Only space for data members is allocated separately for each object.When a member function is called, it is automatically passed an implicit(in built) argument that is a pointer to the object that invoked the function. This pointer is called this. If an object is invoking a member function, then an implicit argument is passed to that member function that points to (that) object. The programmer also can explicitly specify ‘this’ in the program if he desires.)
Eg: Example program to demonstrate the usage of this pointer.
#include<iostream.h>
#include<conio.h>
class Rectangle
{ float area,len,bre;
public:
void input( )
{ cout<<"\nEnter the length and breadth: ";
cin>>this->len>>this->bre;
}
void calculate( )
{ area=len*bre;
//Here Implicit 'this' pointer will be worked.
}
void output( )
{
cout<<"\nThe Area of the Rectangle: "<<this->area;
}
};
void main( )
{
Rectangle R;
clrscr( );
R.input( );
R.calculate( );
R.output( );
getch();
}

Q) What will be the output of the following program:
#include<iostream.h>
#include<conio.h>
#include<ctype.h>
#include<string.h>
void ChangeString(char Text[],int&Counter)
{ char *Ptr=Text;
int Length=strlen(Text);
for(;Counter<Length- 2;
Counter+=2,Ptr++)
{
*(Ptr+Counter)=toupper(*(Ptr+Counter));
}
}
void main( )
{ clrscr( );
int Position=0;
char Message[]=”Pointers Fun”;
ChangeString(Message,Position);
cout<<Message<<”@”<<Position;
}

Q) 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:
Error Line 5 : Cannot modify a const object.
Error Line 7 : Cannot modify a const object.Warning Line 8 : ‘j’ is assigned a value that is never used.Warning Line 8 : ‘ptr’ is assigned a value that is never used.
Explonation:
(1) Error 1 is in Line no.5 ie (*ptr)++. Here ptr is a constant pointer ie the contents cann’t be modified.
(2) Error 2 is in Line no.7 ie ptr=&j;.Here ptr is a constant pointer the address in this pointer can’t be modified. (It is already pointing the address of i.)

Q) Give the output of the following program segment. (Assuming all required header files are included in the program).
void main( )
{ int a=32,*x=&a;
char ch=65,&cho=ch;
cho+=a;
*x+=ch;
cout<<a<<’,’<<ch<<endl; }

Q) Distinguish between
int *ptr=new int(5);
int *ptr=new int[5];
Answer: The int *ptr=new int(5); declares and creates the space for the new data directly.Ie The new operator reserves 2 bytes of memory from heap memory (free pool) and returns the address of that memory location to a pointer variable called ptr, 5 is the initial value to be stored in the newly allocated memory.
The int *ptr = new int[5]; initializes an array element. A memory space for an integer type of array having 5 elements will be created from the heap memory (free pool).

Q) Give the output of the following program:
#include<iostream.h> #include<string.h>
class per
{ char name[20];
float salary;
public:
per(char *s, float a)
{ strcpy(name,s);
salary=a;
}
per *GR(per &x)
{ if(x.salary>=salary)
return &x;
else
return this;
}
void display( )
{ cout<<”Name:“<<name<<”\n”;
cout<<”Salary:“<<salary<<”\n”;
}
};
void main( )
{ Per P1(“REEMA”,10000),
P2(“KRISHNAN”,20000),
P3(“GEORGE”,5000);
per *P;
P=P1.GR(P3);P->display( );
P=P2.GR(P3);P->display( ); }

Q) Give the output of the following program.
#include<stdio.h>
void main( )
{ char *p=”Difficult”;
char c; c=*p++; cout<<c;
}

More Worksheets for Class 12 Computer Science
CBSE Class 12 Computer Science Arrays Stacks Queues And Linked List Worksheet Set A
CBSE Class 12 Computer Science Arrays Stacks Queues And Linked List Worksheet Set B
CBSE Class 12 Computer Science Arrays Worksheet
CBSE Class 12 Computer Science Boolean Algebra Worksheet Set A
CBSE Class 12 Computer Science Boolean Algebra Worksheet Set B
CBSE Class 12 Computer Science C++ Programming Worksheet
CBSE Class 12 Computer Science Case Study Based Questions
CBSE Class 12 Computer Science Class And Objects Worksheet Set A
CBSE Class 12 Computer Science Class And Objects Worksheet Set B
CBSE Class 12 Computer Science Classes Objects Constructors And Destructors Worksheet
CBSE Class 12 Computer Science Communication And Network Concepts Worksheet
CBSE Class 12 Computer Science Computer Networking Worksheet
CBSE Class 12 Computer Science Constructors And Destructors Worksheet
CBSE Class 12 Computer Science Data File Handling Worksheet
CBSE Class 12 Computer Science Database Concepts And Sql Worksheet
CBSE Class 12 Computer Science Dbms And Structured Query Language Worksheet
CBSE Class 12 Computer Science Flow Of Control Worksheet
CBSE Class 12 Computer Science Function Overloading Worksheet
CBSE Class 12 Computer Science Function And Structures Worksheet
CBSE Class 12 Computer Science Inheritance Extending Classes Worksheet
CBSE Class 12 Computer Science Linked Lists Stacks And Queues Worksheet
CBSE Class 12 Computer Science Network And Communication Technology Worksheet
CBSE Class 12 Computer Science Object Oriented Programming In C++ Worksheet
CBSE Class 12 Computer Science Object Oriented Programming Worksheet
CBSE Class 12 Computer Science Oop Classes And Objects Worksheet
CBSE Class 12 Computer Science Pointer Worksheet
CBSE Class 12 Computer Science Program List Worksheet
CBSE Class 12 Computer Science Programming In C++ Worksheet
CBSE Class 12 Computer Science Revision Worksheet Set A
CBSE Class 12 Computer Science Revision Worksheet Set B
CBSE Class 12 Computer Science Revision Worksheet Set C
CBSE Class 12 Computer Science SQL Worksheet Set A
CBSE Class 12 Computer Science SQL Worksheet Set B
CBSE Class 12 Computer Science Stacks Queues And Linked List Worksheet
CBSE Class 12 Computer Science Sure Shot Questions Worksheet Set A
CBSE Class 12 Computer Science Sure Shot Questions Worksheet Set B
CBSE Class 12 Computer Science Sure Shot Questions Worksheet Set C
CBSE Class 12 Computer Science Sure Shot Questions Worksheet Set D
CBSE Class 12 Computer Science Text Files Worksheet
CBSE Class 12 Computers Boolean Algebra Worksheet
CBSE Class 12 Computers Classes And Objects Worksheet
CBSE Class 12 Computers Constructors And Destructors Worksheet
CBSE Class 12 Computers Data Structures Worksheet
CBSE Class 12 Computers Files Worksheet
CBSE Class 12 Computers Inheritance Worksheet Set A
CBSE Class 12 Computers Inheritance Worksheet Set B
CBSE Class 12 Computers Networking Worksheet
CBSE Class 12 Computers Object Oriented Programming Worksheet
CBSE Class 12 Computers Pointers Worksheet

More Study Material

CBSE Class 12 Computer Science Pointer Worksheet

We hope students liked the above worksheet for Pointer designed as per the latest syllabus for Class 12 Computer Science released by CBSE. Students of Class 12 should download in Pdf format and practice the questions and solutions given in the above worksheet for Class 12 Computer Science on a daily basis. All the latest worksheets with answers have been developed for Computer Science by referring to the most important and regularly asked topics that the students should learn and practice to get better scores in their class tests and examinations. Studiestoday is the best portal for Class 12 students to get all the latest study material free of cost.

Worksheet for Computer Science CBSE Class 12 Pointer

Expert teachers of studiestoday have referred to the NCERT book for Class 12 Computer Science to develop the Computer Science Class 12 worksheet. If you download the practice worksheet for one chapter daily, you will get higher and better marks in Class 12 exams this year as you will have stronger concepts. Daily questions practice of Computer Science worksheet and its study material will help students to have a stronger understanding of all concepts and also make them experts on all scoring topics. You can easily download and save all revision worksheet for Class 12 Computer Science also from www.studiestoday.com without paying anything in Pdf format. After solving the questions given in the worksheet which have been developed as per the latest course books also refer to the NCERT solutions for Class 12 Computer Science designed by our teachers

Pointer worksheet Computer Science CBSE Class 12

All worksheets given above for Class 12 Computer Science have been made as per the latest syllabus and books issued for the current academic year. The students of Class 12 can be rest assured that the answers have been also provided by our teachers for all worksheet of Computer Science so that you are able to solve the questions and then compare your answers with the solutions provided by us. We have also provided a lot of MCQ questions for Class 12 Computer Science in the worksheet so that you can solve questions relating to all topics given in each chapter. All study material for Class 12 Computer Science students have been given on studiestoday.

Pointer CBSE Class 12 Computer Science Worksheet

Regular worksheet practice helps to gain more practice in solving questions to obtain a more comprehensive understanding of Pointer concepts. Worksheets play an important role in developing an understanding of Pointer in CBSE Class 12. Students can download and save or print all the worksheets, printable assignments, and practice sheets of the above chapter in Class 12 Computer Science in Pdf format from studiestoday. You can print or read them online on your computer or mobile or any other device. After solving these you should also refer to Class 12 Computer Science MCQ Test for the same chapter.

Worksheet for CBSE Computer Science Class 12 Pointer

CBSE Class 12 Computer Science best textbooks have been used for writing the problems given in the above worksheet. If you have tests coming up then you should revise all concepts relating to Pointer and then take out a print of the above worksheet and attempt all problems. We have also provided a lot of other Worksheets for Class 12 Computer Science which you can use to further make yourself better in Computer Science

Where can I download latest CBSE Printable worksheets for Class 12 Computer Science Pointer

You can download the CBSE Printable worksheets for Class 12 Computer Science Pointer for latest session from StudiesToday.com

Can I download the Printable worksheets of Pointer Class 12 Computer Science in Pdf

Yes, you can click on the links above and download Printable worksheets in PDFs for Pointer Class 12 for Computer Science

Are the Class 12 Computer Science Pointer Printable worksheets available for the latest session

Yes, the Printable worksheets issued for Class 12 Computer Science Pointer have been made available here for latest academic session

How can I download the Class 12 Computer Science Pointer Printable worksheets

You can easily access the links above and download the Class 12 Printable worksheets Computer Science Pointer for each chapter

Is there any charge for the Printable worksheets for Class 12 Computer Science Pointer

There is no charge for the Printable worksheets for Class 12 CBSE Computer Science Pointer you can download everything free

How can I improve my scores by solving questions given in Printable worksheets in Class 12 Computer Science Pointer

Regular revision of practice worksheets given on studiestoday for Class 12 subject Computer Science Pointer can help you to score better marks in exams

Are there any websites that offer free test sheets for Class 12 Computer Science Pointer

Yes, studiestoday.com provides all latest NCERT Pointer Class 12 Computer Science test sheets with answers based on the latest books for the current academic session

Can test papers for Class 12 Computer Science Pointer be accessed on mobile devices

Yes, studiestoday provides worksheets in Pdf for Pointer Class 12 Computer Science in mobile-friendly format and can be accessed on smartphones and tablets.

Are worksheets for Pointer Class 12 Computer Science available in multiple languages

Yes, worksheets for Pointer Class 12 Computer Science are available in multiple languages, including English, Hindi