Tuesday, July 14, 2009

Can u tell about pointers in c++?

give an example program using class with resolution operator

Can u tell about pointers in c++?
Pointers are a type of special variable that store the address of the ordinary data type variables rather than the variable itself. They are also of types int,char, etc to store addresses of variable of type int,char...


eg:


suppose intx=3;


the variable x gets stored at a memory location 1001h


the %26amp; operator defines the address of a variable


now declare an pointer variable of type int


int *y;


y=%26amp;x;


here the address of x gets stored in y.


cout%26lt;%26lt;y;


the result will be like 1001.


this is the simplest way i can give you the concept of pointers but it is a huge topic to be understood completely.


bye
Reply:http://www.google.com/search?q=c%2B%2B+p...
Reply:MyClass *obj = new MyClass();


obj-%26gt;doit();





How's that? -%26gt; is it.


No comments:

Post a Comment