![]() |
What does *pointer_to_class means?
Hello. I am trying to understand a program. In class CGG, there is a definition:
CPGE *PGE; I guess it means that PGE is a pointer to class CPGE. Inside the class CPGE, there is a member function called RSFPtr(). Inside class CGG, there is a statement: (*PGE->RSFPtr())[i] = TempRFState[i]; As far as I understand, PGE->RSFPtr() means calling the member function RSFPtr(). The above statment is different. Could you please let me know what it means? |
Re: What does *pointer_to_class means?
When I saw your question, what immediate came to my mind is that .. the function
RSFptr() must be returning pointer to an array and so the statement (*PGE->RSFPtr())[i] = TempRFState[i]; assigns TempRFState[i] to the i'th element of that array.Try to run the following test code for further clarification : Code: C
There might be some other meaning of (*PGE->RSFPtr())[i] = TempRFState[i]; If I find any other meaning, I'll update this thread :) |
Re: What does *pointer_to_class means?
Thanks for the help. Do you mean the * dereference operator in front of PGE returns to the address of the first element of the array and the [i] moves the pointer to the ith element of the array? When i=0, *PGE just points to the first element of the array?
|
Re: What does *pointer_to_class means?
>> Do you mean the * dereference operator in front of PGE returns to the address of the first element of the array and the [i] moves the pointer to the ith element of the array? When i=0, *PGE just points to the first element of the array?
Yes, that's what I meant ! :) >> Thanks for the help My pleasure ! |
Re: What does *pointer_to_class means?
Thanks again.
|
| All times are GMT +5.5. The time now is 12:51. |