I did not bother to name this...

From Forensic Peccary, 2 Months ago, written in C, viewed 41 times.
URL http://codebin.org/view/334557e4 Embed
Download Paste or View Raw
  1.  //go over every char of the string  
  2.     int k = 0;
  3.     int i = strlen(argv[1]);
  4.     for (int j = 0; j < i; j++)
  5.     {        
  6.         // if it's a number increase k
  7.         if (isdigit(argv[1][j]) == true)
  8.         {
  9.             printf("digit #%i is a number\n", j);
  10.             k++;
  11.         }
  12.         // if it's not a number, end and complain
  13.         else if (isdigit(argv[1][j]) == false)
  14.         {
  15.             printf("digit #%i is not a number, the key may only contain numbers\n", j);
  16.             return 2;
  17.         }
  18.         else
  19.         {
  20.             // If you want to be contrarian
  21.             return 3;
  22.         }
  23.     }

Reply to "I did not bother to name this..."

Here you can reply to the paste above