Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   C++ (http://www.programmingforums.org/forum15.html)
-   -   C++ Symbol Question... ' -> ' (http://www.programmingforums.org/showthread.php?t=12898)

Ade Mar 28th, 2007 3:28 PM

C++ Symbol Question... ' -> '
 
Hi guys. I know this is probably a laughable question but I'm wondering with the symbol -> means in the context of a class. The example I can give is from the text book I'm reading at the moment: 'Mfc Programming with Visual c++'.

:

CClient *pClient;

pClient = new CClient;
pClient->Input();


If you need to know more about the example please let me know and I will post the whole code as that's just selected lines.

I guess that it means that the function 'input()' should act on pClient?

Sorry if this is really simple but googling '->' obviously comes up with nothing and I don't know what it would be called?


Thanks in advance.

DaWei Mar 28th, 2007 3:53 PM

It dereferences a pointer in an object context. pClient is a pointer to an object that has an Input () member function. Your statement executes that one, rather than an Input () member of some other class.

Ade Mar 28th, 2007 4:07 PM

Cheers for the reply. It's times like this I wish I practised my c++ all year round and not just in the two months before assignments are in!!

So pClient is a pointer to an object. The object is of type CClient? Would that mean that Input() is a member function of the class CClient?

DaWei Mar 28th, 2007 4:18 PM

That would be correct.

Ade Mar 28th, 2007 4:20 PM

Brilliant, thanks a lot!


All times are GMT -5. The time now is 2:24 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC