Here's the code:
Code:
#include <iostream.h>
#include <string.h>
int newgame();
int loadgame();
struct player_stats
{
char name[50];
char type[50];
int health;
int mana;
int strength;
int magic;
int agility;
int endurance;
int resist_ice;
int resist_water;
int resist_fire;
int resist_evil;
int resist_holy;
int resist_lightning;
char weapon[50];
char armor[50];
char shield[50];
char head[50];
char wrist1[50];
char wrist2[50];
char neck1[50];
char neck2[50];
char belt[50];
char belt_acc1[50];
char belt_acc2[50];
char skill1[50];
char skill2[50];
char skill3[50];
char skill4[50];
char skill5[50];
char skill6[50];
char skill7[50];
char skill8[50];
char skill9[50];
char skill10[50];
int skill1_lvl;
int skill2_lvl;
int skill3_lvl;
int skill4_lvl;
int skill5_lvl;
int skill6_lvl;
int skill7_lvl;
int skill8_lvl;
int skill9_lvl;
int skill10_lvl;
};
int main()
{
char input;
cout<<"Welcome to ConsoleQuest! Please select an option:"<<endl;
cout<<"(N)ew Game"<<endl;
cout<<"(L)oad Game"<<endl;
cout<<"(E)xit"<<end;
cin>>input;
switch(strlwr(input))
{
case 'n': newgame();
break;
case 'l': loadgame();
break;
case 'e': return 0;
break;
}
return 0;
}
int newgame()
{
player_stats player;
char name[50];
char type;
cout<<\n<<endl;
cout<<"Please choose a character name:"<<endl;
cin>>name;
player.name = name;
cout<<\n<<endl;
cout<<"Please choose a character type:"<<endl;
cout<<"(for help on character types type help)"<<endl;
cout<<\n<<endl;
cout<<"(H)oly Knight"<<endl;
cout<<"(D)ark Knight"<<endl;
cout<<"(I)ce Elemental"<<endl;
cout<<"(F)ire Elemental"<<endl;
cout<<"(L)ightning Elemental"<<endl;
cout<<"(W)ater Elemental"<<endl;
cout<<"H(o)ly Elemental"<<endl;
cout<<"(E)vil Elemental"<<endl;
cout<<"(M)age"<<endl;
cout<<"(C)leric"<<endl;
cout<<"(N)ecromancer"<<endl;
cout<<"N(a)tural Elf"<<endl;
cout<<"Da(r)k Elf"<<endl;
cin>>type;
switch(strlwr(type))
{
case 'h': player.type = "holy_knight";
break;
case 'd': player.type = "dark_knight";
break;
case 'i': player.type = "ice_elemental";
break;
case 'f': player.type = "fire_elemental";
break;
case 'l': player.type = "lightning_elemental";
break;
case 'w': player.type = "water_elemental";
break;
case 'o': player.type = "holy_elemental";
break;
case 'e': player.type = "evil_elemental";
break;
case 'm': player.type = "mage";
break;
case 'c': player.type = "cleric";
break;
case 'n': player.type = "necromancer";
break;
case 'a': player.type = "natural_elf";
break;
case 'r': player.type = "dark_elf";
break;
case "help": help();
break;
}
return 0;
}
Here are the errors:
Code:
--------------------Configuration: Source - Win32 Debug--------------------
Compiling...
Source.cpp
C:\Program Files\Microsoft Visual Studio\MyProjects\ConsoleQuest\Source.cpp(59) : error C2065: 'end' : undeclared identifier
C:\Program Files\Microsoft Visual Studio\MyProjects\ConsoleQuest\Source.cpp(61) : error C2664: 'strlwr' : cannot convert parameter 1 from 'char' to 'char *'
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
C:\Program Files\Microsoft Visual Studio\MyProjects\ConsoleQuest\Source.cpp(77) : error C2017: illegal escape sequence
C:\Program Files\Microsoft Visual Studio\MyProjects\ConsoleQuest\Source.cpp(77) : error C2065: 'n' : undeclared identifier
C:\Program Files\Microsoft Visual Studio\MyProjects\ConsoleQuest\Source.cpp(80) : error C2106: '=' : left operand must be l-value
C:\Program Files\Microsoft Visual Studio\MyProjects\ConsoleQuest\Source.cpp(81) : error C2017: illegal escape sequence
C:\Program Files\Microsoft Visual Studio\MyProjects\ConsoleQuest\Source.cpp(84) : error C2017: illegal escape sequence
C:\Program Files\Microsoft Visual Studio\MyProjects\ConsoleQuest\Source.cpp(99) : error C2664: 'strlwr' : cannot convert parameter 1 from 'char' to 'char *'
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
C:\Program Files\Microsoft Visual Studio\MyProjects\ConsoleQuest\Source.cpp(101) : error C2440: '=' : cannot convert from 'char [12]' to 'char [50]'
There is no context in which this conversion is possible
C:\Program Files\Microsoft Visual Studio\MyProjects\ConsoleQuest\Source.cpp(103) : error C2440: '=' : cannot convert from 'char [12]' to 'char [50]'
There is no context in which this conversion is possible
C:\Program Files\Microsoft Visual Studio\MyProjects\ConsoleQuest\Source.cpp(105) : error C2440: '=' : cannot convert from 'char [14]' to 'char [50]'
There is no context in which this conversion is possible
C:\Program Files\Microsoft Visual Studio\MyProjects\ConsoleQuest\Source.cpp(107) : error C2440: '=' : cannot convert from 'char [15]' to 'char [50]'
There is no context in which this conversion is possible
C:\Program Files\Microsoft Visual Studio\MyProjects\ConsoleQuest\Source.cpp(109) : error C2440: '=' : cannot convert from 'char [20]' to 'char [50]'
There is no context in which this conversion is possible
C:\Program Files\Microsoft Visual Studio\MyProjects\ConsoleQuest\Source.cpp(111) : error C2440: '=' : cannot convert from 'char [16]' to 'char [50]'
There is no context in which this conversion is possible
C:\Program Files\Microsoft Visual Studio\MyProjects\ConsoleQuest\Source.cpp(113) : error C2440: '=' : cannot convert from 'char [15]' to 'char [50]'
There is no context in which this conversion is possible
C:\Program Files\Microsoft Visual Studio\MyProjects\ConsoleQuest\Source.cpp(115) : error C2440: '=' : cannot convert from 'char [15]' to 'char [50]'
There is no context in which this conversion is possible
C:\Program Files\Microsoft Visual Studio\MyProjects\ConsoleQuest\Source.cpp(117) : error C2440: '=' : cannot convert from 'char [5]' to 'char [50]'
There is no context in which this conversion is possible
C:\Program Files\Microsoft Visual Studio\MyProjects\ConsoleQuest\Source.cpp(119) : error C2440: '=' : cannot convert from 'char [7]' to 'char [50]'
There is no context in which this conversion is possible
C:\Program Files\Microsoft Visual Studio\MyProjects\ConsoleQuest\Source.cpp(121) : error C2440: '=' : cannot convert from 'char [12]' to 'char [50]'
There is no context in which this conversion is possible
C:\Program Files\Microsoft Visual Studio\MyProjects\ConsoleQuest\Source.cpp(123) : error C2440: '=' : cannot convert from 'char [12]' to 'char [50]'
There is no context in which this conversion is possible
C:\Program Files\Microsoft Visual Studio\MyProjects\ConsoleQuest\Source.cpp(125) : error C2440: '=' : cannot convert from 'char [9]' to 'char [50]'
There is no context in which this conversion is possible
C:\Program Files\Microsoft Visual Studio\MyProjects\ConsoleQuest\Source.cpp(127) : error C2051: case expression not constant
C:\Program Files\Microsoft Visual Studio\MyProjects\ConsoleQuest\Source.cpp(127) : error C2065: 'help' : undeclared identifier
Error executing cl.exe.
Source.exe - 23 error(s), 0 warning(s)