This is my code, the error is as displayed in the title. And in the compiler:
1>c:\users\ägaren\documents\visual studio 2010\projects\yt tutorial hd\yt tutorial hd\main.cpp(26): error C2446: '==' : no conversion from 'const char *' to 'int'
And:
1>c:\users\ägaren\documents\visual studio 2010\projects\yt tutorial hd\yt tutorial hd\main.cpp(26): error C2040: '==' : 'int' differs in levels of indirection from 'const char [4]'
#include <iostream>
#include <windows.h>
#include <string>
using namespace std;
int main()
{
int gold=600, level=1, exp, damage=10, health=100, mana=100, manaLevel=1; // Main Vars
string name;
cout << "Hello, what is your name?: ";
cin >> name;
cout << "Welcome " << name << " to the field of war,\nYou will stumble upon many other brave warriors.\nTake care and good luck.\n";
Sleep(500);
cout << "You're first task is to eliminate the Orc leader.\n";
int orc=15, troll=25, mage=50; // Enemy Vars
int healthpotion=25, manaPotion=25; // Potions vars
int ifAttack; // if the user chooses to attack or not.
Sleep(500);
cout << "Tossan: " << name << " I hereby order you to attack the orc, he is up north.\nThis message will delete in 2.5 seconds.";
Sleep(2500);
system("cls"); // 1st screen clear.
cout << "After heading north you stumble upon the Orc, will you attack him? [y/n]\n";
cin >> ifAttack;
if (ifAttack == "yes")
}
the if (ifAttack == "yes") is what is giving me the erros, == is underlined but i cant find how to fix it. c++