use a file

hy its me agin! I need to know how to get a program to use a file.
Not lick pictures like text frome a text file.
Do you have eny ideas?
thanks man!
ok so how do i get it to get the file name frome the user?
Maybe do something like this to get a file name from a user

1
2
3
4
5
6
ifstream fin; 
char filename[50]
cout << "Please enter the file name: "
(cin>>filename[50]).get();

fin.open(filename);
Last edited on
Fixed:

1
2
3
4
5
6
7
8
ifstream fin; 
//char filename[50]
string filename;
cout << "Please enter the file name: ";
//(cin>>filename[50]).get();
getline(cin,filename);

fin.open(filename.c_str());

ty disch(:
Topic archived. No new replies allowed.