Program cuts off inputs by program player

I'm not sure if this is a coding problem, as on my computer when you input the player name it is fine, but when my buddy does it he says it cuts off the first character he typed in. When he selects 'no' as a response to if his name is correct the next time around it cuts of the first two characters he types in.

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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
// Runners of Remoria.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <iostream>
#include <string>
#include <sstream>
int userInput;
using namespace std;
bool running = 1;
void clearscreenFunc();
string heroname = "";  //GLOBAL HERO NAME
string herodrug=""; //Drug of choice
void namechoicefunc();
int playerchoice;
int fouropt();

void clearscreenFunc()
{
	cout << string( 100, '\n');
	return ;
} 


int fouropt() //Whenever there is a choice where there are between 1 - 4 options, call this
{
	int playerchoice = 0;
	cout << "Choice: "; 
	cin >> playerchoice;
	switch (playerchoice)
	{
	case 1:
		return 1;
	case 2:
		return 2;
	case 3:
		return 3;
	case 4:
		return 4;
	default: 
		cout << "Try again.\n";
		fouropt;
	}

}

void namechoicefunc()			//handles hero entering name
{
	clearscreenFunc();
	//insert scoped int playerchoice=0 if global doesn't work
	cout << "What name will the people know you by?\n";
	cin.get();
	cout << "Name: ";
	getline(cin, heroname);     //Cleaner way of getting input from player
	cout << "Am I correct in hearing that your name is " << heroname << "?\n" << "1. Yes\n2. No\n";
	playerchoice = fouropt();
	switch (playerchoice)
	{
		case 1:
			if(heroname == "")
			{
				cout << "Please speak up a little bit, I did not hear you.\n";
				cin.get();
				cin.get();
			}
			else
			{
			cout << "Good to know that my hearing hasn't all but gone.\n";
			cin.get();
			break;
			}
		case 2:
			cout << "Are you certain? Let us try again then.\n";
			cin.get();
			cin.get();
			namechoicefunc();
		default:
			cout << "Try again.";
			cin.get();
			cin.get();
			namechoicefunc();
	}

	cout << "Nicely written speel about Drugs leading into a question such as:\n";
	cout << "What was is your method of poison?\n";
	cout << "1: Double U\n2: Jenkum\n3: Miercluf\n4: Minthe\n\n";
	playerchoice = fouropt();
	switch (playerchoice)
	{
		case 1:
			cout << "Speel about Double U\n";
			cin.get();
			cout << "I can see this being your method of coping.\n";
			herodrug = "Double U";
			cin.get();
			break;
		case 2:
			cout << "Speel about Jenkum\n";
			cin.get();
			cout << "Hehe, a butt huffer.\n";
			cin.get();
			herodrug = "Jenkum";
			break;
		case 3:
			cout << "Speel about Miercluf.\n";
			cin.get();
			cout << "I can see this being your method of coping.\n";
			cin.get();
			herodrug = "Miercluf";
			break;
		case 4:
			cout << "Speel about Minthe.\n";
			cin.get();
			cout << "I can see this being your method of coping.\n";
			cin.get();
			herodrug = "Minthe";
			break;
	}
	clearscreenFunc();
	cout << "\n\n\n\n\n\n\nName = " << heroname << "\t\t\t Favorite Drug = " << herodrug << endl;
	cout << "Code for after The Name and Drug choice!";

	cin.get();
	cin.get();
	return;
}


int titleFunc()  //Function that handles the title screen
{
	
	
	cout << "\t\t\t------RUNNERS OF REMORIA------\n\n"; //displays the title
	cout << "\t\t\txxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n";
	cout <<	"\t\t\txxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n";
	cout << "\t\t\txxxxxxxxxx__________ xxxxxxxxxx\n";
	cout << "\t\t\txxxxxxx\\__|________|__/xxxxxxxx\n";
	cout << "\t\t\txxxxxxxxxx|  _   _ |xxxxxxxxxxx\n";
	cout << "\t\t\txxxxxxxxxx|  .   . |xxxxxxxxxxx\n";
	cout << "\t\t\txxxxxxxxxxx\\ / -\\ /xxxxxxxxxxxx\n";
    cout << "\t\t\txxxxxxxxxxxx-------xxxxxxxxxxxx\n";
	cout << "\t\t\txxxxxxxxxxx/|     |\\xxxxxxxxxx\n";
	cout << "\t\t\txxxxxxxxxxx||     ||xxxxxxxxxxx\n";
	cout << "\t\t\txxxxxxxxxxx||	  ||xxxxxxxxxxx\n";
	cout << "\t\t\txxxxxxxxxxx\\|--&--|/xxxxxxxxxxx\n";
	cout << "\t\t\txxxxxxxxxxxx|  v  |xxxxxxxxxxxx\n";
	cout << "\t\t\t.    .   .  |  |  | .   .   .  \n";
	cout << "\t\t\t  .     .  .|  |  |            \n";
	cout << "\t\t\t      .     |--|--|   .   .   .\n";
	cout << "\t\t\t.  .    .    MM MM  .      .   \n";
	cout << "\t\t\t~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n";
	cout << "\n\t\t\t\t    1:Play\n";
	cout << "\t\t\t\t    2:Exit\n\n\n\n"; //displays the options
	cout << "Choice: "; 
	cin >> userInput;
		if(userInput == 1)
		{
			clearscreenFunc();
			cout << "Children are tucked into bed with candlelit stories of heroes present and past.\n";
			cin.get();
			cin.get();
			cout << "Roaring campfires most always cackle with the deeds of brave men,\n";
			cout << "triumphs over adversaries, and glory to the high king and to this\n";
			cout << "land of which he reigns sovereign.\n";
			cin.get();
			cout << "The selfless hero shall always overcome\n";
			cout << "all obstacles and bring victory to his people.\n";
			cin.get();
			clearscreenFunc();
			cout << "Remorian tales make no such mentioning of these heroic acts or deeds.\n";
			cin.get();
			cout << "The story of Remoria more often than not is filled with greed and grey lines.\n";
			cin.get();
			clearscreenFunc();
			cout << "\nYou are Remorian.  Let your path run true. \n"; //Take it to _newgamefunc
			cin.get();
			cout << "Before a story is told, your name must be known.\n";
			cin.get();
			namechoicefunc();	//FUNCTION
			running = 0;
		}
		else if(userInput == 2)
		{
			clearscreenFunc();
			cout << "Good day, young runner.";
			cin.get();
			cin.get();
			running = 0;
		
		}
		else if(userInput != 1 || 2)
		{
		clearscreenFunc();
		cout << "Perhaps you did not understand your options.\n";
		cin.get();
		cin.get();
		cout << "Perhaps you are not yet ready to run.";
		cin.get();
		running = 1;
		
		}
	return 0;
} //Takes care of main title duties

int main()
{
	//titleFunc(); Also a possibility
	while(running)
	{
	titleFunc();	//Will continue the title loop while running boolean == true
	}
	
	return 0;
}



I'm like a week into programming so I'm a baby and I could use some help with this, and anything else messed up with my code.

Thanks in advance.
Don't mix cin and getline. Cin leaves a hanging newline after input, causing the issues with getline.
Is there one I should prefer over the other? That still doesn't explain why it would show up on my computer and clip on his computer though, although I understand what you just said.
Also when I go to use getline(input, heroname) as opposed to getline(cin, heroname) it doesn't want to work, which is why I tried using

getline(cin, heroname).
Topic archived. No new replies allowed.