comprehension problem about classes and vectors

hi everyone
the following code generates this error message:

error: request for member 'geth' in 'temporary', which is of non-class type 'Tmp()'|


#include <iostream>
#include <vector>
using namespace std;

class Tmp{
public:
  Tmp();
  vector<double> geth();

private:
  vector<double> h;
};

vector<double> Tmp::geth(){
  return h;
}

Tmp::Tmp(){h.push_back(345.32);}

int main(){
  Tmp temporary();
  vector<double> vect(temporary.geth());
  return 0;
}


i'd be glad if you could help me, the actual error is in a more complicated program, i generated this one just to look what the error is. so why can't i make the command in bold?

greetings
Last edited on
The problem is with the line above that. It declares a function called temporary taking no arguments and returning a Tmp.
To declare an object remove the parentheses from that declaration.
thanks very much!
what a stupid mistake... ^^
Topic archived. No new replies allowed.