Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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 Go to previous messageGo to previous message
Lance is currently offline  Lance
Messages: 527
Registered: March 2007
Contributor
BTW, xemuth's example code

    StructToResolve3 str3;

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

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Windows7 support
Next Topic: Edited file sometimes reverts changes when running build
Goto Forum:
  


Current Time: Sun May 12 15:31:56 CEST 2024

Total time taken to generate the page: 0.02071 seconds