Need help with my function

I need to call a function in int main() that is in a switch statement. This function holds a sentence and counts how many a's,b's, c's, etc. are in that sentence. I feel like I'm really close, however I am really new to this and it's late and I'm stuck. Any help will be appreciated thanks.
[code]

void Input()
{
char inbuf[257];
char counters { 0 };

for (int position = 0; position < inbuf[257] ; position++)
{
int counterIndex = (int)inbuf[position];

counters++;
}
system("CLS");
cout << "Type sentence to process:" << endl << endl << '\t';
cin.getline(inbuf, 256);
cin.get(counters);
cin.ignore();
system("CLS");
system("pause");
}
Here is how to call this function:
Input();

http://www.cplusplus.com/doc/tutorial/functions/
Sorry, what I was trying to ask (late nights aren't good for the mind) is is my code within the function input() look right? My compiler is giving me an error where it says inbuf[257]: error expression needs class type?
Last edited on
Topic archived. No new replies allowed.