error: base operande of -> has non pointer type ? (code::blocks)

Discussion in 'C Programming' started by Greg2fs, Dec 25, 2009.

  1. Greg2fs

    Greg2fs Guest

    Hello, I am trying to create a stack (LILO) doing like that:
    struct BUFFERS
    {
    BUFFERS* prev;
    BUFFERS* next;
    };
    BUFFERS* last;
    BUFFERS* first;

    last=new BUFFERS;
    last->next=NULL;
    last->prev=NULL;

    first=last;

    last->next=new BUFFERS;
    last->next->prev=last;
    last->next->next=NULL;

    I can compile that under Visual studio but not under code::blocks,
    witch says:
    "error: base operande of << -> >> has non pointer type <<BUFFERS>>"

    Is it wrong to do that, or is it a code::blocks bug, how can I do ?

    Thanks
     
    Greg2fs, Dec 25, 2009
    #1
    1. Advertising

  2. Greg2fs

    Greg2fs Guest

    FORGET THIS MESSAGE
    The problem was somewhere else.
     
    Greg2fs, Dec 25, 2009
    #2
    1. Advertising

  3. Greg2fs

    Flash Gordon Guest

    Greg2fs wrote:

    <snip>

    > last=new BUFFERS;


    <snip>

    > "error: base operande of << -> >> has non pointer type <<BUFFERS>>"
    >
    > Is it wrong to do that, or is it a code::blocks bug, how can I do ?


    Your code is C++ not C, so you need to ask in comp.lang.c++, and when
    you do I suggest you post a complete program which compiles under Visual
    Studio but not code::blocks rather than a fragment.
    --
    Flash Gordon
     
    Flash Gordon, Dec 25, 2009
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Arjen
    Replies:
    3
    Views:
    453
    Scott Allen
    Feb 27, 2005
  2. qazmlp
    Replies:
    1
    Views:
    577
    qazmlp
    Apr 10, 2005
  3. Vijai Kalyan
    Replies:
    4
    Views:
    310
    Jim Langston
    Sep 7, 2005
  4. Hicham Mouline
    Replies:
    1
    Views:
    603
    Victor Bazarov
    Apr 20, 2009
  5. matt
    Replies:
    1
    Views:
    284
    George Ogata
    Aug 6, 2004
Loading...

Share This Page