小编Sam*_*ara的帖子

比较两个字符串C++

你能简单地比较两个字符串string1==string2吗?

void ex_file_licensing::compare_license(const std::string &reference,
                                        const std::string &result)
{
    if (reference == result)
        cout << "It's the same" << endl;
    else 
        cout << "It's diffrent" << endl;
    return;
}
Run Code Online (Sandbox Code Playgroud)

如果是,此代码将正常工作或我应该进行一些修改.

感谢大家

c++ string

1
推荐指数
2
解决办法
1万
查看次数

标签 统计

c++ ×1

string ×1