这个运行该方法的C ++主要方法驱动程序有什么问题?

问题描述

本学期我正在学习C ++(刚刚学习Java),并使用Codewars进行一些C ++编码练习(这是我最有效的练习方法,但只需要方法而不是驱动程序),但不确定如何为该方法创建驱动程序,以便我可以在IDE中进行练习。

我主要在这里缺少什么,因此它可以在我的IDE中运行?解决方案(不是我的代码)有效,但是我的主要方法无法驱动它。

#include <iostream>
#include <cctype>
#include <unordered_set>

int main(int argc,char *argv[]) {
using namespace std;
cout << is_isogram("Dermatoglyphics"); //error: use of undeclared identifier 'is_isogram'
}

bool is_isogram(std::string str) { //warning: Function is never used
std::unordered_set<char> char_set;
for (const auto &c : str) {
    auto c_lower = std::tolower(c);
    if (char_set.count(c_lower) == 0) char_set.insert(c_lower);
    else return false;
}
return true;
}

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)