title: Trouble reading .csv files in C++
body: <p>I am working on a project where I intend on connecting to a database, grabbing a .csv file, reading it, manipulating the data and then returning it back to the database. Fairly simple and straight forward but I am still learning so if any one could point me in the right direction I would greatly appreciate it. Right now I have a simple program that is trying to read a .csv file and return the values to me printed on the console. I have been trying to find some good online resources for this but have came up short. Here is my code for what I have stumbled through so far.</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;fstream&gt;
  #include &lt;string&gt;
  
  using namespace std;
  
  int main ()
  {
  
  int loop = 1;
  
  while(loop = 1)
  {
  
  cout &lt;&lt; "Welcome! " &lt;&lt; endl;
  
  ifstream myfile;
  
  myfile.open ("..\\ Source\External\\ Sample.csv", ifstream::in);
  </code></pre>
  
  <p>The real path to this file is C:\Documents and Settings\RHatfield\My Documents\C++\Product Catalog Creator\Source\External\Sample.csv</p>
  
  <pre><code>while (myfile.good())
  cout &lt;&lt; (char) myfile.get();
  
  myfile.close();
  system("PAUSE");
  
  return 0;
  }
  
  
  }
  </code></pre>
  
  <p>Now the issue is it does not print the values so I do not know that they are properly being captured. I have a feeling it is my file path but that's the only way I can find to write it without it throwing errors. I think it's something with the spaces in the file path but I can't seem to find another way to make it work. I am not looking for a handout and this is not homework or just regular work. I am trying to learn and having trouble teaching myself so if someone knows what the issue is and can help me fix it or even point me to a relevant article online would be greatly appreciated.</p>