Why won't strings show up as the whole word?

Okay, take a look(briefly at the beginning parts)at my script, or if you know why, just tell me :3 why my string wont pop up as a full word, for the battle scene (that I haven't finished).. But they do pop up, or at least, the one pop's up.

The one that does work is 'playerName', all the others come up as one letter. Why?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
#include <cstdlib>
#include <iostream>
#include <string>

using namespace std;

int main(int argc, char *argv[])
{
    //integers and all that
    bool nameConfirm, battleMode, confirm;
    confirm = false;
    string playerName, playerWeapon, playerArmorName, enemArmorName, enemName, enemWeapon;
    char yesOrNo, battleCommand;
    char gameEnder;
    int playerHealthCurrent, playerHealthTotal, playerWeaponDmg, playerArmor;
    int enemWeaponDmg, kills, enemHealthTotal, enemHealthCurrent, enemArmor;
    //getName
    cout << "***Welcome to Creature-Slayer 1--Gladiator***\n\n\n";
    cout << "Who are you?(first name only, hit enter when finished)\n";
    cout << "I am: ";
    cin >> playerName;
    cout << playerName << ", eh?(y/n)";
    //confirm it
    do{
    cin >> yesOrNo;
    switch(yesOrNo)
    {
    case 'y':
         cout << "Very well.\n";
         nameConfirm = true;
         break;
    case 'n':
         cout << "Then restart the program!(type something then hit enter to end)";
         cin >> gameEnder;
         return 0;
    default:
         cout << "Type y(yes) or n(no) then hit enter.\n(y/n)";         
             
         
         
         }
         }
         while (nameConfirm == false);
    //game explanation     
    cout << playerName << ", you've lived your life full of crime. Now you must fight as a gladiator. You will battle others, to the death. If you win you may take their weapons or equipment, then continue back to the cells to ready yourself for the next fight. This is now your life. There's no leaving, you battle endlessly. Good luck, gladiator.\n\n";
    //tutorial begin
    cout << "WELCOME TO THE TUTORIAL. AS A BEGINNER, YOUR ARMOR IS NOT THAT GOOD. ALSO, YOUR DAMAGE IS LOW BECAUSE YOU HAVE NO WEAPON. IN THIS TUTORIAL YOU WILL BATTLE YOUR FIRST MONSTER. TO ATTACK, YOU CLICK (A). THIS WILL TELL YOU WHAT HAPPENED, HOW \nMUCH YOU HIT, HOW MUCH THE ENEMY HIT. FOR THIS PRACTICE, YOUR ENEMY WILL BE A \nRAT.\n";                  
    cout << "So, you wanna play?(y/n)";
    //do they??? 
     do{
    cin >> yesOrNo;
    switch(yesOrNo)
    {
    case 'y':
         cout << "Very well.\n\n\n";
         confirm = true;
         break;
    case 'n':
         cout << "Then quit the program!(type something then hit enter to end)";
         cin >> gameEnder;
         return 0;
    default:
         cout << "Type y(yes) or n(no) then hit enter.\n(y/n)";
         }
         }         
         while (confirm == false);
    confirm = true;
    
    //First  Battle Mode
    battleMode = true;
    //Player Initilization
    playerHealthCurrent = 25;
    playerHealthTotal = 25;     
    playerWeapon = 'fists';
    playerArmorName = 'Beginners Cloth';
    playerArmor = 0;
    playerWeaponDmg = (rand() % 4);
    //Enemy Initilization     
    enemName = 'rat';
    enemHealthCurrent = 3;
    enemHealthTotal = 3;
    enemWeapon = 'claws';
    enemArmorName = 'pelt';
    enemArmor = 0;
    enemWeaponDmg = (rand() % 4);
    //Start The Battle!!!!
    do{
     cout << "Enemy: " << enemName << "|Hit Points: " << enemHealthCurrent << "/" << enemHealthTotal;
     cout << "|Armor: " << enemArmorName << "|Weapon: " << enemWeapon;
     cout << "\n----------------------------------------------------------";
     cout << "\n" << playerName << "|Hit Points: " << playerHealthCurrent << "/" << playerHealthTotal;
     cout << "|Armor: " << playerArmorName << "|Weapon: " << playerWeapon;
     cout << "\n(a)ttack\n(d)rink potion\n(q)uit game\n";
     cin >> battleCommand;
    //battle command     
         switch(battleCommand)
    {
    case 'a':
         
         break;
    case 'q':
         cout << "Good bye then.(type something then hit enter to end)";
         cin >> gameEnder;
         return 0;
    default:
         cout << "Type y(yes) or n(no) then hit enter.\n(y/n)";
         }
     
     
     
     
     
     
     }while(enemHealthCurrent > 0 );       
    
    
    
    
    
    cin >> gameEnder;
    return 0;
}




the battle is near the end. the ints and strings and chars are all at the top.



:) ty for any help.
Last edited on
Strings should be encased in " ", not ' '.
in //player initilization:
use double quotes not singles. singles are for constants
Oops, haha thanks guys. I was tired. ^^
singles are for constants
No they are not. Single quotes are for single characters, string literals themselves are always constant.
Topic archived. No new replies allowed.