so heres a snippet of my code:
cout << "enter keyphrase: \n";
cin >> nextchar;
while(nextchar != '.')
{
isalreadyin = 0;
for (int i=0; i<counter; i++)
{
if (key[i] == nextchar)
isalreadyin = 1;
}
if(isalreadyin ==0)
{
key[counter]=nextchar;
counter ++;
}
cin >> nextchar;
}
at the moment i have '.' as my terminiating character. but i want new line to be it. But i cannot get it to work. ive tried '\n' and that dont work. i also tried the ascii value but that dont work so i kinda came to a dead end. So could anybody give me ideas on why it wont work?
p.s the nextchar is a char so could it be that char variable cannot accept '\n'