hello,
I have been attempting to use atoi to bring in a filename, and pass this name into a another function for it to work with......this is in main:
int main (int argc, char *argv[])
{
cout<<"Please enter filename\n";
if (argc != 1){
cout<<"You must enter a filename\n"; }
char filename;
cin >> filename;
filename = atoi(argv[1]);
//I want this function to take this filename and use it in another
//function:
filereader(filename);
}
//this function is in a .h file , and in the function before I had to manually type in the filename, but now I want to be able to use a command argument to type in the name:
void filereader (char infile){
char *filein = infile; }
I'm getting quite a few errors, first of being an implicit conversion, which does make sense but I am not quite sure what approach to use?? any help will be appreciated. thanks



LinkBack URL
About LinkBacks


