title: How to assign File path to variable in c++
body: <p>I have a program which calculates md5 hash.
  I can enter the text and it will generate the md5 code.
  I want to get files from computer, for example text file and generate md5 for that. The problem is that i don't know how to get the file location and assign it to variable so i can put that variable in md5 generator function.</p>
  
  <pre><code>cout &lt;&lt; "md5 of 'grape': " &lt;&lt; md5("example") &lt;&lt; endl;
  </code></pre>
  
  <p>as you can see in the above code i enter the md5 function argument which is "example" string, so i want something like this</p>
  
  <pre><code>string foo = "C:\\Users\\User\\Downloads\\1.txt";   
  cout &lt;&lt; "md5 of 'grape': " &lt;&lt; md5(foo) &lt;&lt; endl;
  </code></pre>
  
  <p>so this will calculate md5 for "C:\Users\User\Downloads\1.txt" string, but i want to calculate the 1.txt file's md5.</p>