title: How do you check the length of a double in C++
body: <p>I'm using this code to check that a student number being entered is the correct number of digits. Is there a function like .length() that will work for the variable type double? Thanks!</p>
  
  <pre><code>do {
      cout &lt;&lt; "Student's number: (Numeric only)";
      cin &gt;&gt; studentNumber;
      cin.ignore();
  }
  while (studentNumber.length() != 6);
  </code></pre>