Im making this single player MUD with C++ and I keep getting theese error messages
- error C2679: binary '>>' : no operator defined which takes a right-hand operand of type 'class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >' (
- or there is no acceptable conversion)
- error C2679: binary '<<' : no operator defined which takes a right-hand operand of type 'class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >' (
- or there is no acceptable conversion)
- error C2447: missing function header (old-style formal list?)
- Error executing cl.exe."
Code:
#include <iostream>
#include <fstream>
#include <string>
#include <C:\Documents and Settings\Camper #1.IDKPPL\Desktop\MUD\look.h>
#include <C:\Documents and Settings\Camper #1.IDKPPL\Desktop\MUD\info.h>
#include <ctime>
using namespace std;
ifstream a_file ("info.txt");
void sleep(unsigned int mseconds)
{
clock_t goal = mseconds + clock();
while (goal > clock());
}
int info(int EXP,int HP);
int look(int room);
int main()
{
HP = 100;
EXP = 0;
room = 1;
string name;
string command("look");
cout<<"Whats your name?";
cin>> name;
cout<<"Welcome "<< name <<"\n";
switch (command)
{ case 'look':
look(); break;
case 'info':
info();
break;}
return 0; }
Can someone please assist me?