title: What is cache in C++ programming?
body: <p>Firstly I would like to tell that I come from a non-Computer Science background &amp; I have been learning the C++ language.
  I am unable to understand what exactly is a cache?
  It has different meaning in different contexts.
  I would like to know what would be called as a cache in a C++ program?
  For example, if I have some <code>int</code> data in a file. If I read it &amp; store in an <code>int</code> array, then would this mean that I have 'cached' the data?
  To me this seems like common sense to use the data since reading from a file is always bad than reading from RAM.
  But I am a little confused due to <a href="http://cplus.about.com/od/glossar1/g/cache.htm" rel="noreferrer">this</a> article.</p>
  
  <blockquote>
    <p>In a CPU there can be several caches, to speed up instructions in
    loops or to store often accessed data. These caches are small but very
    fast. Reading data from cache memory is much faster than reading it
    from RAM.</p>
  </blockquote>
  
  <p>It says that reading data from cache is much faster than from RAM.
  I thought RAM &amp; cache were the same.
  Can somebody please clear my confusion?</p>
  
  <p><strong>EDIT:</strong> I am updating the question because previously it was too broad.
  My confusion started with <a href="https://stackoverflow.com/questions/18584739/reading-from-a-large-text-file-into-a-structure-array-in-qt/18617145#18617145">this</a> answer. He says </p>
  
  <blockquote>
    <p>RowData and m_data are specific to my implementation, but they are
    simply used to cache information about a row in the file</p>
  </blockquote>
  
  <p>What does cache in this context mean?</p>