Thread: Iterator problem

  1. #1
    Registered User
    Join Date
    Oct 2006
    Posts
    7

    Iterator problem

    Hi,
    I'm trying to access the name of a business with itNb->Name() but itNb doesn't seems to be able to access anything in the class business ...

    This is the error it give's me : error C2839: invalid return type 'ClBusiness **' for overloaded 'operator ->'


    Am I doing this right ?

    Code:
    	for(;;)
    		{
    		const string name= GetStringNotEmpty("Enter the name or [X] to exit : ");
    		bool modified= false;
    
    		ClIterBusiness itNb= m_business.begin();
    
    		while (itNb != m_business.end() || itNb->Name() == name)
    			++itNb;
    
    		/***/
    		if (modified == true || name == "X") break;
    		/***/
    	
    		cout << "The name is not valid\n";
    		}

  2. #2
    Registered User SKeane's Avatar
    Join Date
    Sep 2006
    Location
    England
    Posts
    234
    Code:
    (*itNb)->Name() == name

  3. #3
    Registered User
    Join Date
    Oct 2006
    Posts
    7
    Thank you very much.

Popular pages Recent additions subscribe to a feed