Trouble Calling a Function

Hi. I'm kinda new to C++ and I have this doubt and was wondering if anyone could help me.

I've created a project using Dev-C++ and I'm having trouble using a funtion.

I have a header file, were I define the funtions and a .cpp were I implement the funtions. I also have a main.cpp were I have an interface menu, this is were the problem occurs.

The code is like this:

Header file declaration:

Class Warehouse
{
private:
//...
vector <Client> client;
//...
public:
//...
void ClientRegist(Client &c);
//...
}

The implemented function on the .cpp:

void Warehouse::ClientRegist(Client &c)
{
ofstream client_reg(f_client.c_str(), ios::app);

client_reg << c.getCName() << endl;
client_reg << c.getCAddress() << endl;
client_reg << c.getPNameC() << endl; //the product the client wants to buy
client_reg.close();

client.push_back(c); //save in the vector
}

Know were it gets tricky, in the main.cpp:
#include "warehouse.h"

bool Cliente()
{
switch(opt)
{
...
case 2: hmp.ClientRegist();
}
}

int main(int agrc, char* argv)
{
Warehouse hmp("client.txt"); //file with the information about the client
//string f_client = "client.txt"
}

When I call the ClientRegist, the compiler spots an error saying it doesn't match any declared function, but there's a similar function in the format ClientRegist(Client&), so I put it like that on the main.cpp, but I compile it again and it says thats it's missing it's primary expression, so I put ClientRegit(Client &c), and then it tells me that c is undeclared, but it is like that in the header file.

Can anyone help?

Thanks in advance.
This belongs in the beginners section. And please use code tags (push the # putton to the right of the edit box).
Topic archived. No new replies allowed.