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

G

Greg2fs

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
 
F

Flash Gordon

Greg2fs wrote:

last=new BUFFERS;

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

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top