【发布时间】:2019-10-29 13:04:03
【问题描述】:
我一直在努力解决这个问题。我希望你们中的几个人对此有所了解,因为我完全没有想法。
bool characterGetCFG1(string typeOverLoad, string var_name, string full_text) {
int pos = full_text.rfind(var_name) + var_name.length() + 1;
char character = full_text.at(pos);
if (character == 't' || 'T') {
cout << full_text << "\n";
cout << "features.assigned, " << var_name << ", " << full_text.at(pos) << ".\n";
cout << "returned true \n";
cout << character << "\n";
return true;
}else{
cout << "returned false \n";
return false;
}
void setconfig(glow_t passed_glow) {
ifstream file;
file.open("config.cfg");
if (!file.is_open()) {
exit(-10);
}
std::string raw;
while (file.good()) {
raw.assign(std::istreambuf_iterator<char>(file), std::istreambuf_iterator<char>());
file >> raw;
}
file.close();
feats.setGlow(characterGetCFG1("t", "glow", raw));
不用担心括号我在项目中的数量是正确的,遗憾的是我无法将它们全部放入代码标签中。
编辑:我忘了在下面添加“config.cfg”文件。
发光=假
【问题讨论】:
-
character == 't' || 'T'永远为真,因为'T'永远为真