hi
i'm having a problem when i use pointer to pointer
i've tried my best to make this work .. but it didn't
i've got a run time error!
PLEASE .. Please .. please i need help :'(
if any one have tutorial about how can i work with pointer to pointer please put it 4 me
Can any one help me with this code
#include<iostream>
using namespace std;
class Example
{
Example **object2;
int size;
public:
Example()
{
size=2;
Example **object2=new Example* [size];
for(int i=0; i<size; i++)
object2[i]=NULL;
}
void print2()
{
int i=0;
while (i<2)
{
(*object2)->print(); // <<<< run time error
i++;
object2++;
}
cout<<"Dosn't Work !"<<endl;
}
void print(){ cout<<"\nPlease Help ! "<<endl;}
};
int main(){
Example **object=new Example* [2];
for(int i=0; i<2; i++)
object[i]=NULL;
(*object)->print();
(*object)->print2();
return 0;
}