I am very new to C++, coming form Java and C. My book does not mention private functions and Google searches don't turn up much. This should be trivial for me, but I can't get it to work.
I have this code:
#ifndef RUNDATABASE_H
#define RUNDATABASE_H
#include <iostream>
#include <string>
class RunDatabase
{
public:
int main();
protected:
private:
bool checkIfProperID(std::string);
};
#endif // RUNDATABASE_H
And in another file:
#include "RunDatabase.h"
int main()
{
std::string id; // after this, I initialize id
if(!checkIfProperID(id))
{
std::cout << "Improperly formatted student ID, must be numeric" << std::endl;
break;
}
}
bool RunDatabase::checkIfProperID(std::string id)
{
return true;
}
I get this error: error: 'checkIfProperID' was not declared in this scope
Using MinGW g++ 4.4.1 on Windows 7 64 bit.
Thanks for any help.