Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > error: base operande of -> has non pointer type ? (code::blocks)

Reply
Thread Tools

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

 
 
Greg2fs
Guest
Posts: n/a
 
      12-25-2009
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

 
Reply With Quote
 
 
 
 
Greg2fs
Guest
Posts: n/a
 
      12-25-2009
FORGET THIS MESSAGE
The problem was somewhere else.
 
Reply With Quote
 
 
 
 
Flash Gordon
Guest
Posts: n/a
 
      12-25-2009
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
base class public type (non template and template base class) Hicham Mouline C++ 1 04-20-2009 03:28 PM
Why (type*)pointer isn't equal to *(type**)pointer? lovecreatesbeauty C Programming 10 01-17-2006 09:30 AM
Value of a pointer to base type when assigned to a derived type Vijai Kalyan C++ 4 09-07-2005 05:12 AM
Format of compiler generated derived destructor when base has 'virtual ~base() throw():" qazmlp C++ 1 04-10-2005 03:09 PM
[RTTI] cast base class pointer to <templated> derived class pointer tirath C++ 3 10-12-2003 01:44 PM



Advertisments