string x vs string x()

Hello I have a trivial question but did not know how to google it.

1. what is the difference between
1
2
3
4
5
void func()
{
std::string x; //vs
std::string x(); // does this one imply it is a function ??
}




Yes, the second declaration declares a function, not a variable.
Thank you!
Topic archived. No new replies allowed.