title: Reading a file with c++ containing chars and numbers
body: <p>I have a text file containing sort of a graph presentation, as such:</p>
  
  <p>7</p>
  
  <p>{5, 2, 3}, {1,5}, { }, { }, {3}, { }, { }</p>
  
  <p>Now, I know how to read a file and get in into an int </p>
  
  <pre><code>    while ((n = myfile.get()) != EOF) 
  </code></pre>
  
  <p>or into a string line by line</p>
  
  <pre><code>    getline (myfile,line)
  </code></pre>
  
  <p>The problem I have, is that with both of these options I can't really seem to compare every character I extract and check if it's a number or a "," or "{" or "}".
  Is there a simple way of doing that? I've been banging my head with this for hours since yesterday. I've tried some isdigit and casting, but that didn't work for me as well and really complicated stuff.</p>