Hi I’m teaching myself C++ and I’m getting this error
'verifyDateInput' was not declared in this scope
The error occurs on the call to verifyDateInput below.
void setAll(std::string dateString) {
if(verifyDateInput(dateString.c_str())) {
std::vector<std::string> results = split(dateString, '/');
month = results.at(0).;
day = results.at(1);
year = results.at(2);
}
}
I’m sure this is just some nuance of the language that I’m not getting. The function call is within a struct declaration in a header file, and within the header file I have the declaration of the function. (not sure if declaration is the right word…..the thing where I just write the function signature)
bool verifyDateInput(const char* input);
Thanks for any help!
So remember kids, always declare your functions above their usages in a program file. The problem was that my function declaration is below the struct declaration.
Thanks to Naveen and chris for immediately recognizing this