I am trying to get my program to check if a code is valid or not. If the code is invalid, it will be output into a file. The code is valid if in the format: letter/letter/digit/digit/letter/letter(w/o slashes). I've tried to incorporate cctype in some way but I cannot figure out how to get it to work.
I appreciate your response, but I am just learning c++ and really don't understand your example. What is "std::"? And, I'm not sure how I can apply this to my program.
"std" is a namespace, which is why you are using the line "using namespace std." The scope operator - "::" - allows you to access a member of the std namespace. You don't have to use the scope if you prefer using "using namespace std;" So you would have this:
I see what you're doing and I tried changing my code but it doesn't work. I'm not outputing anything to the console so I don't know how to use this with my program. I just need the program to check a list of strings from a file to see if they are of the format "letter letter digit digit letter letter". And, if not, they will be sent to an "invalid" file. This is what i have changed so far:
[code]