-4
    // 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);

}

This is my code so far, and I'm getting the following era's: In function 'int main()': 13:17: warning: comparison with string literal results in unspecified behaviour [-Waddress] 13:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 13:43: warning: comparison with string literal results in unspecified behaviour [-Waddress] 13:43: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]

Please help me fix these, errors, I'm not entirely sure what's causing them I've tried fixing them, and failed.

Samidamaru
  • 1,031
  • 7
  • 18
  • 1
    5th line inside main should be `string answer` instead of `char answer` – therainmaker Dec 15 '15 at 06:50
  • 1
    Well Butt IntheButtEbolaAods, a `char` can only hold a single character but you seem to think it can hold the entire string `Mrs. Manuel` or `Ms. Manuel`. – user657267 Dec 15 '15 at 06:50
  • You have a future problem: http://stackoverflow.com/questions/21567291/why-does-stdgetline-skip-input-after-a-formatted-extraction – chris Dec 15 '15 at 06:52

2 Answers2

0

answer is char. It should be string.

seamaner
  • 91
  • 5
0

char takes in only one character you might be looking to use std::string or a char[] and iterate through the array of chars.

SemicolonExpected
  • 589
  • 1
  • 10
  • 36