Could anyone tell me the syntax to input a file?
My program has accesss to the location of the file through a open file dialog...
I tried everything..even the tutorial on MSDN, but it won't work .
Could anyone tell me the syntax to input a file?
My program has accesss to the location of the file through a open file dialog...
I tried everything..even the tutorial on MSDN, but it won't work .
Don't exactly understand question, but you will probably want fstream.
http://www.cprogramming.com/tutorial/lesson10.html
I'm sory if I wasn't clear, I want to know the syntax to open a file in Visual C++ 2005. I tried the fstream...didn't realy work..maybe I did something wrong?
I added the header files at the top of my source and added the code. I read somewhere that I would have to change CLR to the old syntax, but then everything else stops working.
I'm almost sure fstream should work. Here's sample code that should be vary easy to integrate
If that doesnt work then use this as a last resortCode:#include <fstream> #include <string> using std::ifstream; using std::string; string Read_File(char * name) { ifstream in; string file; in.open(name); char temp; while (temp = in.get()) file += temp; return file; }
http://msdn.microsoft.com/library/de...s/readfile.asp
TY very much!