Hello
I am working on this program and I cannot seem to get it working. I am trying to get an input of a line using cin.getline() but i am unable to get that line and assign it into an array of characters. Everything compiles correctly but the alphabet[50]'s output is blank when executed.
For example:
int main() {
char line[50];
num = 0;
char alphabet[27];
cin.getline(line,27);
num = 0;
while (line[num++] != 0);
num -=2;
for (int i = 0; i < num; i++) {
line[i] = alphabet[i];
}
}
Can someone explain to me what I am doing wrong?
Thanks