I
_ivan
Hello,
So I think the answer to this question is going to be rather simple.
Basically I have a pointer to a class, and I want to have a function
to call to initialize it.
After this function is called, the pointer is still NULL.
Here is a simplified version, but basically the same:
void main(){
MyClass *ptr = NULL;
createMyClass(ptr);
}
createMyClass(MyClass *ptrToClass){
ptrToClass= new MyClass();
}
Any reason why ptr would still be NULL after createMyClass is called?
Thanks,
_ivan
So I think the answer to this question is going to be rather simple.
Basically I have a pointer to a class, and I want to have a function
to call to initialize it.
After this function is called, the pointer is still NULL.
Here is a simplified version, but basically the same:
void main(){
MyClass *ptr = NULL;
createMyClass(ptr);
}
createMyClass(MyClass *ptrToClass){
ptrToClass= new MyClass();
}
Any reason why ptr would still be NULL after createMyClass is called?
Thanks,
_ivan