I'm not sure why you picked that example - it seems like it should result in 'true'. I notice your logic is not quite right though. Your loop tests each character in turn to see if it is invalid for...
Type: Posts; User: Sean4u
I'm not sure why you picked that example - it seems like it should result in 'true'. I notice your logic is not quite right though. Your loop tests each character in turn to see if it is invalid for...
You would normally use that 'break' - or put the validity condition in your loop expression (for, while, do etc) - so that your loop stops as soon as the input is invalid because there's no more...
'If' conditions evaluate to a boolean - one of two values. If you're studying computing, you should probably read up on DeMorgan's Laws for the background to why this code works out this way, but you...
You should only be using one for loop for this like (pseudo code)
check strings are same length
for (all characters or positions in one of the strings)
if (character in first string is *)
...
The easiest way to tackle this might be to check first if *either* char is a wildcard, and if it is go on to the next char.