我正在尝试查看正在读取的字符串的结尾是否为"
. 如果不是,我希望它打印出一些东西。
if(!line.find_last_of("\"")) {
cout << "Extra parameter is typed.";
continue;
我试图使用find_last_of
,但是当我运行它时,无论命令是否有额外参数,都会打印额外的参数。例子:
lc "file.txt" -suppose to true so it's suppose to continue program but returns false
lc "file.txt" lk - suppose to return false and it does but should only return false for this type of case.