title: Having problems with cstring arrays
body: <p>I am having trouble with my code with something with arrays. I am getting the following errors</p>
  
  <pre><code>In function ‘int main(int, const char**)’:
  75: error: cannot convert ‘char*’ to ‘char (*)[81]’ for argument ‘1’                                                                  ion(char (*)[81], OneItem*, int&amp;, int&amp;)’
   In function ‘void parseInformation(char (*)[81], OneItem*, int&amp;, in
  164: error: ISO C++ forbids comparison between pointer and integer
  166: error: incompatible types in assignment of ‘const char [2]’ to
  169: error: ISO C++ forbids comparison between pointer and integer
  174: error: ISO C++ forbids comparison between pointer and integer
  174: error: ISO C++ forbids comparison between pointer and integer
  176: error: invalid conversion from ‘char*’ to ‘char’
  </code></pre>
  
  <p>The code doesn't line up with the line numbers. I have tried multiple things googled some things still haven't found a solution.</p>
  
  <pre><code>const int MAX_CHARACTERS = 80;
      const int MAX_INVENTORY = 12;
  
      typedef char OneLine[MAX_CHARACTERS + 1];
      struct OneItem
      {
          char product[MAX_CHARACTERS + 1];
          int quantity;
          float unitPrice;
          float totalPrice;
      };
  
  
  
      int main( const int argc, const char* argv[] )
      {
  
          OneLine fileName;
          ifstream inFile;
  
          OneLine readLine;
          OneItem inventory[MAX_INVENTORY];
  
  
          int readLineIndex;
          int structureCounter = 0;
          int averageQuantity;
          float averagePrice;
          float averageTotalPrice;
  
          displayIntroduction();
  
          getFileName( argc, argv, fileName );
          if (!inFile)
          {
              cout &lt;&lt; "File not found: " &lt;&lt; fileName &lt;&lt; endl;
          }
          else 
          {
              inFile.open(fileName);
              while(!inFile.getline(readLine, MAX_CHARACTERS, '\n').eof())
              {
                  if (structureCounter &lt; MAX_INVENTORY)
                  {
                      parseInformation(readLine,inventory, readLineIndex, structureCounter);
                  }
              }
  
  void parseInformation(OneLine readLine[],OneItem inventory[], int &amp; readLineIndex, int &amp; structureCounter)
  {
      int tempIndex = 0;
      int valueCounter = 0;
      OneLine tempArray;
      while(readLine[readLineIndex] != '\n')
      {
          tempArray = "\0";
  
  
          while(readLine[readLineIndex] == ' ')
          {
              readLineIndex += 1;
  
          }
          while(readLine[readLineIndex] != ' ' &amp;&amp; readLine[readLineIndex] != '\n')
          {   
              tempArray[tempIndex] = readLine[readLineIndex];
              tempIndex += 1;
              readLineIndex += 1;
          }
          if(valueCounter == 0)
          {
              for(int i = 0; i &lt;= strlen(tempArray); i++)
              {
                  inventory[structureCounter].product[i] = tempArray[i];
              }
              valueCounter += 1;
          }
          else if(valueCounter == 1)
          {
              inventory[structureCounter].quantity = atoi(tempArray);
              valueCounter += 1;
          }
          else
          {
              inventory[structureCounter].unitPrice = atof(tempArray);
              structureCounter += 1;
          }
  
  
  
      }
      return;
  </code></pre>