You are using atoi function? Why do you want to convert the filename to an integer?
Code:
#include <cstring>
#include <iostream>
void filereader (char *infile){
// You could already write:
ifstream input(infile);
// or in C:
FILE *input(infile);
char filein[80];
strcpy(filein,infile);
}
int main (int argc, char *argv[])
{
cout<<"Please enter filename"<<endl;
if (argc != 1){
cout<<"You must enter a filename"<<endl;
}
char filename[80];
cin >> filename;
filereader(filename);
}
char character; means that you define just a one character
char chararray[80] means what you want.
You could also use C++ strings.