CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: Pointer n00b

  1. #1
    Join Date
    Oct 2007
    Posts
    1

    Pointer n00b

    all i am trying to do is make my pointer linked list a member of my linkedQueue and have been unsuccessful for the last few hours. this is what i have...

    Code:
    #ifndef linkedQueue_H
    #define linkedQueue_H
    
    #include<iostream>
    
    using namespace std;
    
    struct Node 
    {
           int elem; 
           Node *next; 
    };
    
    class linkedQueue
    {  
          typedef int el_t;
             
          public:
                 linkedQueue();
                 ~linkedQueue();
                 
                 void addRear(el_t newNum);
                 void deleteFront(el_t oldNum);
                 
                 bool isEmpty();
                 int getSize();
                 void displayAll();
    
                 Node *rear;
                 
          private:
                  int *front,*rear,count;
                  void queueError(char* mesg);
    };
    
    #endif
    Last edited by ovidiucucu; October 18th, 2007 at 03:16 AM. Reason: [CODE] tags added

  2. #2
    Join Date
    Mar 2001
    Location
    Czech Republic
    Posts
    78

    Re: Pointer n00b

    And what is the problem with this code?

  3. #3
    Join Date
    Feb 2003
    Location
    Iasi - Romania
    Posts
    8,244

    Re: Pointer n00b

    [ Redirected thread ]

  4. #4
    Join Date
    Oct 2006
    Location
    Singapore
    Posts
    346

    Re: Pointer n00b

    Your class linkedQueue has two members named rear.
    Code:
    Node *rear;
                 
          private:
                  int *front,*rear,count;
    Believe in your Dreams, Work for what you Believe in.
    My thoughts? Angelo's Stuff
    Some fun things I've done: RayWatch, QuickFeed, ACSVParser

    @ngelo

  5. #5
    Join Date
    Oct 2002
    Location
    Timisoara, Romania
    Posts
    14,360

    Re: Pointer n00b

    all i am trying to do is make my pointer linked list a member of my linkedQueue and have been unsuccessful for the last few hours. this is what i have.
    Usually it helps listing the errors too.
    Marius Bancila
    Home Page
    My CodeGuru articles

    I do not offer technical support via PM or e-mail. Please use vbBulletin codes.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured