Here's the code I have written in Visual Studio:
#include <iostream>
#include <conio.h>
using namespace std;
class pointer
{
private:
int *ptr;
int **ptr1;
public:
int FindSize();
};
int pointer :: FindSize()
{
ptr1 = &ptr;
return **ptr1;
}
int main()
{
pointer point;
int size = point.FindSize();
cout << size;
getch();
return 0;
}
I am getting this error:
Unhandled exception at 0x00E02BB4 in Pointers.exe: 0xC0000005: Access violation reading location 0xCCCCCCCC