I am letting the user input a sentence(telling them to put in - signs). I want the program to count how many the user puts in. For some reason, the program keeps saying 0(no matter how many "-" I put in the sentence. What am I doing wrong?
That means you are putting whatever the user enters, into the 100th element in the array (which is a really bad idea in this case, as sent stops at 99).
Change it to cin >> sent to have the input entered into the entire array instead and it should work correctly.
well i remembered me using ascii characters for something like this but as james already said the solution is changing it to cin >> sent; instead of cin >> sent[100];. code works with either'-' or 45 it doesn't matter