Is there any way to detect how many times cretin characters can appear in a serial number ? EX if I have a code of 12 characters including letters and numbers in this code. I want to make sure that user will use only number four for once. Using if statement what's the possibility to get that function?
In this following code I made sure that the user will promote 12 characters only. Should I copy the serial code into an array then do searching for number four and once the program detects that the user used number four more than once it sends an error, or is there an easier way to do so?
using namespace std;
cout<< "please enter a serial number of 12 characters:";
cin >> serial_number;
if (length!=12 )
cout << "The code you have entered cannot be processed because the code must be contained of 12 characters exactly";
cout << " that's correct code";