Hi
I made a class that has a public integer pointer
and I use this pointer in main like code below: (Just a sample code,I know about memory leaks and other related bugs,just a sample)
#include<iostream.h>
class Cat
{
public:
int *Pointer;
};
main()
{
Cat *pCat;
pCat=new Cat;
pCat->Pointer = new int;
pCat->*Pointer=34 //this makes a compiler error
delete pCat->Pointer;
return 0;
}
I need to access this(Pointer) public pointer of class cat directly not from class methods;