// Example program
#include <iostream>
#include <string>
int main()
{
std::string name;
std::cout << "What is your name? ";
getline (std::cin, name);
std::cout << "Hello. How is your day going " << name << "?\n";
char answer;
std::cin >> answer;
if (answer == "Mrs. Manuel"|| answer == "Ms. Manuel")
std::cout << "You're the person I made this for! YAY YAY YAY YAY";
std::string gender;
std::cout << "(!)Disclaimer, may be offensive to some(!) What is your gender?";
std::string ask;
std::cout << "Now what is that I can show you? ";
getline (std::cin, name);
}
这是我的代码到目前为止,我已经得到了以下时代: 在函数&#39; int main()&#39;: 13:17:警告:与字符串文字比较导致未指定的行为[-Waddress] 13:17:错误:ISO C ++禁止指针和整数之间的比较[-fpermissive] 13:43:警告:与字符串文字比较导致未指定的行为[-Waddress] 13:43:错误:ISO C ++禁止指针与整数[-fpermissive]
之间的比较请帮助我解决这些问题,错误,我不完全确定导致他们的原因我尝试修复它们,然后失败了。
答案 0 :(得分:0)
回答是char。它应该是字符串。
答案 1 :(得分:0)
console.log(bark.bark)
只接受您可能希望使用char
或std::string
的一个字符,并遍历字符数组。