Is there any difference between List x; and List x();?

3:33:00 PM 0 Comments

big difference!
Suppose that List is the name of some class. Then function f() declares a local List object called x:
void f()
{
  List x;     // Local object named x (of class List)
  ...
}
But function g() declares a function called x() that returns a List:
void g()
{
  List x();   // Function named x (that returns a List)
  ...
}

Some say he’s half man half fish, others say he’s more of a seventy/thirty split. Either way he’s a fishy bastard.