title: Validation of password input in C
body: <p>I have no idea how to go further with this program that I'm about to create. This is the idea:</p>
  
  <blockquote>
    <p>Validate the password input to check if the password has at least one
    uppercase letter, lowercase letter and a number.</p>
  </blockquote>
  
  <p>Some parts of it is broken at the moment. For instance the false, true statements. And the "undynamic" char array in the main function. I don't know how to make that at the moment either. But it explains what I'm looking for.</p>
  
  <p>So how can I validate this without writing too much code?</p>
  
  <p><strong>This is my current code:</strong></p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;ctype.h&gt;
  
  int passval(char pw[])
  {
      int x;
  
      for (x = 0; x &lt; sizeof(pw); x++) {
          if ( (isalnum(pw[x])) || (ispunct(pw[x])) ) {
              return 0;
          } else {
              return 1;
          }
      }
  
      return 0;
  }
  
  int main()
  {   
      char password[20];
  
      printf("Enter password: ");
      scanf("%s", password);
  
      if (passval(password) == TRUE) {
          printf("Password is TRUE");
      }
  
      return 0;
  }
  </code></pre>