Need to count how many numbers are in the read data file then create warning message

kkkkkkk
Last edited on
Please put your code between 2 code blocks. You can find them first under "format" to the right.
I see the "format" but I do not know what to do to get it into 2 code blocks
You see the icon <>. Press on it and you will get 2 code blocks. Put the code between them.
Correct?
Much better. Im not an expert but, maybe you could declare int counter;
And after every cin >> you can do counter++
And after you've inputted everything. you can maybe say

1
2
3
4
if(counter !=10)
{
cout << "Error, file has less or more than 10 wheels. Check your input data file and re-run the code";
}


Im not sure if there is a better way of doing it, but this is how I would have done it, being a newbie.
Last edited on
lolapurple wrote:
kkkkkkk
Please do not delete/blank your posts after receiving help - it makes this topic useless for others with the same problem.
Topic archived. No new replies allowed.