hi! so i have an assignment which consist of a bunch of functions. One of the functions is used to read characters inputted by the user and place them into an array, it also has to initialize the parameter current to zero.This is what I have,and i wanted to make sure I was doing it correctly. thank you.
1 2 3 4 5 6 7 8 9 10
void input (char letters[11], int& current)
{
int entered;
current = 0;
cout << "Enter 11 non-blank characters: ";
for (entered = 0; entered < current; entered++)
current = current + letters[entered];
cin >> letters[entered];
}
when I call the function into main I can enter numbers, but when I try and use my function to print what I put in, it won't print the word i typed in. so what should i set entered to? I thought the loop had to start at index 0 to go through it.
for that function in particular I need to prompt the user for the size characters (which is 11 characters), read the characters and place them in the array, i also need to initialize the variable current to 0.