Your problem is not completely specified. Should non-alpha characters be treated as lower-case or upper case? If they should be considered uppercase you could use:
#include <string>
#include <algorithm>
using namespace std;
bool validMeno(const string& text) {
return !text.empty() && isupper(text[0]);
}
bool validPriezvisko(const string& text) {
return !any_of(begin(text), end(text), islower);
}
On the other hand if non-alpha characters should be considered lower-case:
#include <string>
#include <algorithm>
using namespace std;
bool validMeno(const string& text) {
return !text.empty() && !islower(text[0]);
}
bool validPriezvisko(const string& text) {
return all_of(begin(text), end(text), isupper);
}