Hi folks!
I'm almost newbie in c++ programming, so please don't blame me :)
I have a little (i hope) problem with following code and i really can't
understand what i'm missing :(
Hope you can help me!
The following code is from my simple GUI class.
// in my gui.h definition file, i have:
struct _placed_items {
struct _items *item;
struct _placed_items *next;
};
struct _windows {
struct _placed_items *placeditems;
}
struct _items {
// some stuff
}
// in a private function of the class gui.cpp, i have:
struct _items *newitem=new _items;
struct _placed_items *newplaceditem=new _placed_items;
newplaceditem->item=newitem;
When i try to compile it, i have this error:
gui.cpp(180) : error C2440: '=' : cannot convert from 'struct
GUI::_items *' to 'struct _items *'
Types pointed to are unrelated; conversion requires reinterpret_cast,
C-style cast or function-style cast
(Wrong line is: newplaceditem->item=newitem;)
For read pleasure, you can find a well formatted version of the code here:
http://nopaste.simosnap.com/1151
Thanks in advance for your time!!!