ASCII file input

I need to use ASCII files as input to my program, and haven't got a clue about how can i do that (the program should read the file's location from keyboard). So how can i include an ASCII type file into the code? Thanks for all the help beforehand!
http://www.cplusplus.com/reference/iostream/fstream/
open with
1
2
3
4
// get the filename
char[256] filename;
cin.getline(filename, 256);
ifstream yourFile(filename);


then you can access char by char with get(), use the extraction operator >>, or put the data into a block with read. Also, you need to #include <fstream>
Last edited on
Topic archived. No new replies allowed.