im trying to use stacks to output files with names here is what i have so far ive tried every combination of file.open i could think of any suggestions?
#include <iostream>
#include <string>
#include <fstream>
#include <stack>
using namespace std;
int main(){
stack<string> filename;
string fname;
int count;
ofstream file;
while(count!=3){
cin>>fname;
count++;
filename.push(fname);
}
while(!filename.empty()){
cout<<filename.top()<<endl;
filename.pop();
}
return 0;
}