here the code first off:
It never loads the file even if its entered correctly. I did a test cout so i know its the infile line. My theory is that the FileLocation is taken as a literal not a variable because of the quotes. Problem is i cant built it without quotes, so how can i accomplish this? I know its a lame question but never tried it before.Code:#include "stdafx.h" #include <iostream> #include <fstream> #include <string> using namespace std; int main(int argc, char* argv[]) { string FileLocation; string Extension = ".cpp"; bool Quit = false; ofstream outfile; ifstream infile; cout << "Enter path to file (no ext please): "; getline(cin,FileLocation); FileLocation += Extension; infile.open("FileLocation"); return 0; }



LinkBack URL
About LinkBacks



pen(const char *,int)' : cannot convert parameter 1 from 'class std: