title: How do I count the number of indexes used in an array
body: <p>Write a program that asks the user to enter their name. First Name and Last Name are entered separately by the user. The program then tells the following:
  •   Which part (First name, or Last name), has more character, and how many more characters.
  •   Total number of vowels used in the complete name. 
  •   Tells the user if the First Name and Second Name are same.
  This is my assignment and we cannot use strings library. We are supposed to use the character arrays to go about doing this.</p>
  
  <p>Up till now I haven't been able to understand how can I figure out the number of indexes I use to store characters.
  int count = 0;
      cout &lt;&lt; "Enter you first name: ";</p>
  
  <pre><code>char arr[10];
  
  cin.getline(arr, 10);
  
  for (int i = 0; i &lt; 10; i++) {
  
      if (arr[i] != ' ') {
          count++;
      }
      else {
          break;
      }
  }
  
  int x= sizeof(arr) / sizeof(arr[10]);
  cout &lt;&lt; arr;
  
  cout &lt;&lt; endl &lt;&lt; count&lt;&lt; endl&lt;&lt;x;
  
  
  return 0;
  </code></pre>
  
  <p>but still I haven't come around to a solution.</p>