我知道我听起来很像一个新手通过问这个,但我很好奇,知道为什么我通过一个字符串的if语句使用简单的运算符时出现错误?下面是我在做什么,以产生错误:C++如果在字符串上的语句错误
void Shift (string updown)
{
if (updown == "hel")
{
//random code
}
}
和我包括是:
#include <iostream>
#include <fstream>
#include <Windows.h>
using namespace std;
什么是错误?此外,使用名称空间是不满意的。 – Antimony 2012-08-08 05:22:49
这不是皱眉(除了在.h文件和其他一些情况下)。使用名称空间是使代码易于管理和可读的最佳方式。 – jcoder 2012-08-08 10:32:45