Declaration of 'MenuInterface' hides class member

Issue as above. From what I’ve seen on the internet it is from the disambiguation of Menuinterface, But I have no idea.

Any help would be much appreciated.

void UMainMenu::SetMenuInterface(IMenuInterface* MenuInterface)
	this->MenuInterface = MenuInterface;

The parameter name has the same name as the member variable which is why Sam has this->, to make it less confusing. This is known as “shadowing”.

Personally I would prefix the parameter with In.

That has worked, Thanks for your quick response :slight_smile:

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms