Thread: Linked Lists error: m_deck undeclared identifier

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Nov 2007
    Posts
    56

    Linked Lists error: m_deck undeclared identifier

    My compiler's throwing a fit because m_deck is an undeclared identifier. But I think I DID declare it: Please tell me what you think from the following snippets:

    I have declared card data structures in a card.h header file.
    I have declared a list of cards as a nonmember function in my deck.h header file.
    Code:
    typedef std::list<s_card> cardList_t;
    and I have declared a cardList_t named m_deck in my game.h header file.
    Code:
    cardList_t m_deck;
    Then I use it in my game.cpp definition file.
    Code:
    void shuffleDeck()
    {
    	cardNodeptr cur = head;
    
    	int x, y;
    
    	for(int count=1; count<=52; count++)
    	{
    		x = 1+rand()%52;
    		y = 1+rand()%52;
    
    		m_deck.insert(y,m_deck.retrieve(x));
    		m_deck.removeCard(x);
    	}
    }
    Thanks as always for your time!
    Last edited by marQade; 05-15-2008 at 05:58 PM. Reason: Attached my code...maybe it'll help.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. An error is driving me nuts!
    By ulillillia in forum C Programming
    Replies: 5
    Last Post: 04-04-2009, 09:15 PM
  2. Game Pointer Trouble?
    By Drahcir in forum C Programming
    Replies: 8
    Last Post: 02-04-2006, 02:53 AM
  3. Why wont my function exit correctly?
    By LightsOut06 in forum C Programming
    Replies: 2
    Last Post: 10-09-2005, 09:23 PM
  4. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 06:39 AM
  5. Problem with Visual C++ Object-Oriented Programming Book.
    By GameGenie in forum C++ Programming
    Replies: 9
    Last Post: 08-29-2005, 11:21 PM