Unless you need your built-in C++ way to do validation as well, the "obvious" parse is:
int parseDate(const std::string &input) {
int month;
int day;
int year;
if (std::sscanf(input.c_str(), "%d/%d/%d", &month, &day, &year) != 3) {
// handle error
} else {
// check values to avoid int overflow if you can be bothered
return 10000 * year + 100 * month + day;
}
}
You can use stream extractors instead of sscanf
if you want to write several lines of code type safety.
There's certainly nothing in the standard library to do the 10000 * year + 100 * month + day
for you. If you're not wedded to that exact value, you just want an integer in the correct order, then you could look at whether your platform has a function to tell you the so-called "Julian day".