title: How can i input a table as an array?
body: <p>I need to input a data file (below):</p>
  
  <pre><code>        14        16        18        20        22        24        
          27        30        35        40        45        50
  
          8         10        11        12        13        14        
          16        18        21        24        27        30
  
          0.4       0.5       0.5       0.5       0.5       0.5        
          0.6       0.6       0.6       0.6       0.6       0.6
  
          16        17        18        19        20        21        
          22        23        25        26        27        29
  
          2.0       2.2       2.2       2.3       2.4       2.5        
          2.6       2.7       2.8       2.9       3.1       3.2
  
          1.7       1.8       2.0       2.2       2.4       2.5        
          2.8       3.0       3.4       3.8       3.8       3.8
  </code></pre>
  
  <p>Where when selecting column one those vales will be outputted.</p>
  
  <p>Here is my code; can anyone see any errors?</p>
  
  <pre><code>void TimberType() {
  
      ifstream inFile;
      inFile.open("TableOfValues.txt", ios::in );
      string TimberValues;
      inFile &gt;&gt; TimberValues;
      inFile &gt;&gt; bendStr &gt;&gt; tensPara &gt;&gt; tensPerp &gt;&gt; compPara &gt;&gt; compPerp &gt;&gt; shear &gt;&gt; mElasModPara &gt;&gt; elasMod5Para &gt;&gt; mElasModPerp &gt;&gt; mShearMod &gt;&gt; density &gt;&gt; mDensity;
  
  
      cout &lt;&lt; "Please enter timber type " &lt;&lt; endl;
      cout &lt;&lt; "C14 = 1        C16 = 2        C18 = 3        C20 = 4" &lt;&lt; endl;
      cout &lt;&lt; "C22 = 5        C24 = 6        C27 = 7        C30 = 8" &lt;&lt; endl;
      cout &lt;&lt; "C35 = 9        C40 = 10    C45 = 11    C50 = 12" &lt;&lt; endl;
      cin &gt;&gt; timberType;
  
      {
          switch (timberType) {
          case 1:
              timberType = 1;
              cout &lt;&lt; "You have selected timber type C14" &lt;&lt; endl;
              cout &lt;&lt; TimberValues[1];
              break;
          case 2:
              timberType = 2;
              cout &lt;&lt; "You have selected timber type C16" &lt;&lt; endl;
              cout &lt;&lt; TimberValues[2];
              break;
          case 3:
              timberType = 3;
              cout &lt;&lt; "You have selected timber type C18" &lt;&lt; endl;
              cout &lt;&lt; TimberValues[3];
              break;
          case 4:
              timberType = 4;
              cout &lt;&lt; "You have selected timber type C20" &lt;&lt; endl;
              cout &lt;&lt; TimberValues[4];
              break;
          case 5:
              timberType = 5;
              cout &lt;&lt; "You have selected timber type C22" &lt;&lt; endl;
              cout &lt;&lt; TimberValues[5];
              break;
          case 6:
              timberType = 6;
              cout &lt;&lt; "You have selected timber type C24" &lt;&lt; endl;
              cout &lt;&lt; TimberValues[6];
              break;
          case 7:
              timberType = 7;
              cout &lt;&lt; "You have selected timber type C27" &lt;&lt; endl;
              cout &lt;&lt; TimberValues[7];
              break;
          case 8:
              timberType = 8;
              cout &lt;&lt; "You have selected timber type C30" &lt;&lt; endl;
              cout &lt;&lt; TimberValues[8];
              break;
          case 9:
              timberType = 9;
              cout &lt;&lt; "You have selected timber type C35" &lt;&lt; endl;
              cout &lt;&lt; TimberValues[9];
              break;
          case 10:
              timberType = 10;
              cout &lt;&lt; "You have selected timber type C40" &lt;&lt; endl;
              cout &lt;&lt; TimberValues[10];
              break;
          case 11:
              timberType = 11;
              cout &lt;&lt; "You have selected timber type C45" &lt;&lt; endl;
              cout &lt;&lt; TimberValues[11];
              break;
          case 12:
              timberType = 12;
              cout &lt;&lt; "You have selected timber type C50" &lt;&lt; endl;
              cout &lt;&lt; TimberValues[12];
              break;
  
          }
  
          cout &lt;&lt; "Bending Strength: " &lt;&lt; bendStr &lt;&lt; "N/mm^2" &lt;&lt; endl;
          cout &lt;&lt; "Tension in Parallel: " &lt;&lt; tensPara &lt;&lt; "N/mm^2" &lt;&lt; endl;
          cout &lt;&lt; "Tension in Perpendicular: " &lt;&lt; tensPerp &lt;&lt; "N/mm^2" &lt;&lt; endl;
          cout &lt;&lt; "Compression in Parallel: " &lt;&lt; compPara &lt;&lt; "N/mm^2" &lt;&lt; endl;
          cout &lt;&lt; "Compression in Perpendicular: " &lt;&lt; compPerp &lt;&lt; "N/mm^2" &lt;&lt; endl;
          cout &lt;&lt; "Shear: " &lt;&lt; shear &lt;&lt; "N/mm^2" &lt;&lt; endl;
  
      }
  }
  </code></pre>
  
  <p>At the moment I am just receiving 0 values for Bending Strength, Tension in Parallel, Tension in Perpendicular, Compression in Parallel, Compression in Perpendicular, and Shear. </p>
  
  <p>Any ideas will be much appreciated. Thank you.</p>