Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
cs-142:2d-arrays-and-files [2014/10/21 14:01]
kseppi
cs-142:2d-arrays-and-files [2015/10/14 17:51] (current)
kseppi
Line 65: Line 65:
  string filelocation;​  string filelocation;​
  getline(cin,​filelocation);​ // Important to use getline here, there may be blanks in the file name  getline(cin,​filelocation);​ // Important to use getline here, there may be blanks in the file name
 +        // Also remove "s, windows adds them in some cases
  if (filelocation.substr(0,​1) == "​\""​) {  if (filelocation.substr(0,​1) == "​\""​) {
  filelocation = filelocation.substr(1,​filelocation.length()-2);​  filelocation = filelocation.substr(1,​filelocation.length()-2);​
  }  }
 +
  cout << "FYI, writing to " << filelocation << endl;  cout << "FYI, writing to " << filelocation << endl;
  ofstream myfile (filelocation);​ // Open the file at the location the user asks for  ofstream myfile (filelocation);​ // Open the file at the location the user asks for
cs-142/2d-arrays-and-files.txt ยท Last modified: 2015/10/14 17:51 by kseppi
Back to top
CC Attribution-Share Alike 4.0 International
chimeric.de = chi`s home Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0