Iterator problem

This is a discussion on Iterator problem within the C++ Programming forums, part of the General Programming Boards category; Hi, I'm trying to access the name of a business with itNb->Name() but itNb doesn't seems to be able to ...

  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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21