i'm using the arguments to main and then passing them to another function to open a file with the argument as the file name...this is the code:
this is the readFile function:Code:int main(int argc, char* argv[])
{
char *fname;
fname = argv[1];
readFile(fname);
}
it doesn't work...what am i doing wrong? i've only given the pertinent code...Code:void readFile(char *file)
{
ifstream fin (file);
}
Regards,
Farooq