title: Understanding Error "error: cannot convert ‘char**’ to ‘const char*’ for argument ‘1’ to ‘double atof(const char*)’"
body: <p>So I'm working on this assignment for my class and book is REALLY unclear about how to use the argc, argv, and atof() items (which are all new to me), so I am trying to use them but I am getting this error, and I'm not quite sure how to correct it:</p>
  
  <p>This is my Error:</p>
  
  <pre><code>error: cannot convert ‘char**’ to ‘const char*’ for argument ‘1’ to ‘double atof(const char*)’
  </code></pre>
  
  <p>This is my Code:</p>
  
  <pre><code>int main(int argc, char** argv)
  {
     //Code removed
  
     //Code removed
  
     float *feet = atof(argv); // &lt;-- it says the error is with this line
  
     //Code removed
  
     return 0;
  }
  
  float convertFeet(float feet)
  {
     float meters = feet * .3048;
  
     return meters;
  }
  </code></pre>
  
  <p>The "purpose" of this program is to convert given feet into a float, and then display those (while also converting them to meters).  I already know the convertFeet() function works as I tested it before adding the atof(), argc, &amp; argv portions of the program.  If anyone could help me understand this error better and the solution that would be very helpful!</p>
  
  <p>Thanks again,</p>
  
  <p>-Stephen</p>
  
  <p>P.S.  This is for sure a compile error as my compiler told me.  I just didn't post that portion of the error as I considered that portion of the code to be superfluous.</p>