I am writing some code. I need an if statement that basically states if a digit does not appear in this span of 80 characters, you will need one.
I am currently setting up an if statement inside my for loop. The for loop controls the length of the string that is being looked at. The if statement I currently have says:
if(isdigit(array[i]))
I need it to convert isdigit to a FALSE boolean statement (i.e. is"not"digit).
The way I currently has it written produces that statement for each indices that are read. So if I enter 10 letters, the cout statement appears 10 times.
I want my code to look through my entire string and identify if there is a digit or not as well as a few other things. I am under the impression I will need to use isdigit at some point. My thought process was that a loop would cover the span of the desired section of the char string. I am not sure how to go about doing this without a loop.
I need the code to look through it all and produce certain statements depending on digit existence or not, etc.
cire's code shows exactly that. The for loop checks that every char in the array is not a digit. If a char is a digit then the loop is left early (using break). If the loop is left early then i will not equal 40. So you then check (outside of the loop) if i is not equal to 40 i != 40 and print your error there.
Thank you so much for all of your help! This forum really is very helpful! I look forward to reading more that has been posted on this site and these forums!