Wanting to know how to check that 9 characters entered into a string variable are either a '0' or '1'. Want to convert string to c-string array and validate each of the nine characters. main part of code below:
//change string to c-string array to prepare for validating for 0 or 1
//int sizeArray = valBitset.size();
strcpy (bitsetArray, valBitset.c_str()); //copy valbitset as c-string to bitsetArray
//validate for 0's or 1's
for (int i=0; i<SIZEARRAY; i++)
{
if(strcmp (bitSetArray[i], '0') == 0 || strcmp (bitSetArray[i], '1') == 0)
{
cout << "Invalid characters. Must be a 0 or 1.\n";