Docsity

OOP Lab Exercise: Pointers and Arrays, Study notes of Programming Languages

Partial preview of the text

Download OOP Lab Exercise: Pointers and Arrays and more Study notes Programming Languages in PDF only on Docsity!

LAB 6

OOP

Submitted To:

Sir M.Riaz

Submitted By:

Sumair Rauf

Date:

May 6,

PROGRAM

 #include

 #include<conio.h>

 using namespace std;

 int main ()

 {

 int abc;

 int a = 10;

 int *ptr = &abc;

 cout<<"the value of a is : "<<a<<endl;

 cout<<"the value of ptr is : "<<&ptr<<endl;

sum = a+b;

cout<<"the sum of a and b is : "<<sum<<endl;

getch();

OUT PUT

*p1=8;

p2=p1;

p1=p2;

*p2=10;

cout<<"pointer"<<s1<<endl;

cout<<"second pointer"<<s2<<endl;

return 0;