View Single Post
Old 05-22-2004, 10:58 AM   #4 (permalink)
~Relentless~
Registered User
 
Join Date: May 2004
Posts: 4
~Relentless~ is on a distinguished road
Hmm, it seems I rushed a bit into song there... Apparently there's one problem with the code...:

Code:
#include <iostream>
#include <string>

using namespace std;

char choicechar[1000];
string charnick;

void main()
{
	cout << "Enter nick: ";

	cin >> choicechar[1000];
		
	cin.getline(choicechar, 1000, '\n');

	charnick = choicechar;

	cout << endl << endl << charnick;
}
The output will be like this:
Enter nick: bjørn mikkelsen

jørn mikkelsen

What obscure reason causes this effect? Should it not be able to read the full line of the input? Thanks in advance...
~Relentless~ is offline   Reply With Quote