Я изучаю базовый С++, и сейчас у меня есть строка от пользователя, и я хочу проверить, набрали ли они все имя файла (включая .txt) или нет. У меня есть строка, но как я могу проверить, заканчивается ли строка с ".txt"?
string fileName;
cout << "Enter filename: \n";
cin >> fileName;
string txt = fileName.Right(4);
Метод Right(int)
работает только с CString, поэтому приведенный выше код не работает. Я хочу использовать регулярную строку, если это возможно. Любые идеи?