title: Printing Char Array Element
body: <p>I've been hung up on this for the past two hours, and it's really starting to irritate me. I'm using standard C, trying to print a char array's element.</p>
  
  <p>The following is a snippet that works(prints entire array),</p>
  
  <pre><code>CreditCard validate_card(long long n) {
  
      CreditCard cc; // specify new credit card
      cc.n = n; // specify card num as passed
      cc.valid = false; // initialize as invalid
      cc.type = AEX; // initialize at american express
  
      bool valid;
  
      char s[20];
      sprintf( s, "%d", n ); // convert credit card number into char array
      printf("%s\n", s);
      return cc;
  }
  </code></pre>
  
  <p>The following snippet does not work,</p>
  
  <pre><code>CreditCard validate_card(long long n) {
  
      CreditCard cc; // specify new credit card
      cc.n = n; // specify card num as passed
      cc.valid = false; // initialize as invalid
      cc.type = AEX; // initialize at american express
  
      bool valid;
  
      char s[20];
      sprintf( s, "%d", n ); // convert credit card number into char array
      printf("%s\n", s[0]);
      return cc;
  }
  </code></pre>
  
  <p>On that note, if anyone could also too explain to me how to concatinate char array elements to char pointers, I'd be grateful.</p>