In the first
for loop, what do you think happens when
cometname has a size of 4? (or anything less than 7)
Same possible problem below with
oh ok thanks very much, but you didnt tell me what is assertion failure
An assertion failure is when the program fails a tst to assert that it is functioning properly.
In your case, accessing an index that is out of bounds fails the test that the index must be in bounds. This check is only in debug mode because it would cause slowdown in release.
ok thank you very much,any ideas how to solve it?
Use the .length() function on the strings rather than assuming that 7 and 6 are the correct sizes.
ok, i understand now.thanks,and sorry for disturbance