getting a weird warning in Visual Studio 2005:
warning C4133: '=' : incompatible types - from 'PointNode *' to 'PointNode *'
struct definition:
struct PointNode {
int x;
int y;
struct PointNode *next;
};
declaration and usage:
struct PointNode* pPointHead;
...
pPointHead = pPointHead->next;
The warning itself says they are the same types, why would it complain?
(unfortunately i can't tag C4133)
Your struct should look like this:
struct PointNode {
int x;
int y;
PointNode *next; // remove struct keyword
};
Declare and use like this:
PointNode *pPointHead; // remove struct keyword
pPointHead->next;
When you add the struct keyword, the compiler thinks that you are declaring a new different struct with the same name.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With