Error '&' reference cannot used

Back to topics list To post a new topic, please log in or register
avatar
3
AllTimeNoob 2015.06.06 16:57
 

Hi,

my English not so good, so Sorry.

I have written a class.

class TEST
{
   private:
      
      string T_TakeProfit;
      ...
      ...

   public:

      const string &GetT_TakeProfit()   {return T_TakeProfit;}
      ...
 

And then i  became an Error like " '&' reference cannot used".

Can anyone tell me, what im doing wrong? I don't see it.

avatar
3
AllTimeNoob 2015.06.06 20:59 #
 
No one here?
avatar
13000
WHRoeder 2015.06.06 22:14 #
 
You can't return references. Only objects or pointers to classes. Just return the string.
avatar
3
AllTimeNoob 2015.06.06 22:34 #
 
Ok, so mql4 not work with "string"-References as Return Value, right?
Back to topics list  

To add comments, please log in or register