Home » U++ TheIDE » U++ TheIDE: Other Features Wishlist and/or Bugs » Assist++ typedef struct analysis problem
Re: Assist++ typedef struct analysis problem [message #58218 is a reply to message #58217] |
Sun, 27 March 2022 03:54 |
Lance
Messages: 527 Registered: March 2007
|
Contributor |
|
|
BTW, xemuth's example code
is not legal C/C++ code: it won't compile.
It should be
struct StructToResolve3 str3;
And the following code compiles
struct C{
void hi(){}
};
struct D{
void hi(){};
};
int main()
{
C D;
struct D d; // the keyword struct cannot be done without
D.hi();
d.hi();
}
or this also compiles
struct C{
void hi(){}
};
struct D{
void hi(){};
};
int main()
{
D d;
C D;
D.hi();
d.hi();
}
Conclusion: in a context where a class/struct name is used as identifier(and hence hidden by it), to refer to the class/struct, a leading classor struct keyword needs to be prepended.
[Updated on: Sun, 27 March 2022 03:55] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Thu May 23 16:49:38 CEST 2024
Total time taken to generate the page: 0.02118 seconds
|