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. Advertisements

  2. Greg2fs

    Greg2fs Guest

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

  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. Advertisements

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:
    688
    Scott Allen
    Feb 27, 2005
  2. qazmlp
    Replies:
    1
    Views:
    777
    qazmlp
    Apr 10, 2005
  3. lovecreatesbeauty

    Why (type*)pointer isn't equal to *(type**)pointer?

    lovecreatesbeauty, Jan 14, 2006, in forum: C Programming
    Replies:
    10
    Views:
    718
    Peter Shaggy Haywood
    Jan 17, 2006
  4. Vijai Kalyan
    Replies:
    4
    Views:
    411
    Jim Langston
    Sep 7, 2005
  5. Hicham Mouline
    Replies:
    1
    Views:
    839
    Victor Bazarov
    Apr 20, 2009
  6. matt
    Replies:
    1
    Views:
    490
    George Ogata
    Aug 6, 2004
  7. Steven Taylor
    Replies:
    9
    Views:
    575
    Brian Candler
    Apr 27, 2009
  8. rickman
    Replies:
    5
    Views:
    661
    rickman
    Mar 30, 2013
Loading...