kitty said:
Can i provide for command line switches in c++ ?
Sure, why not?
For example i can say perl readfile.pl -f filename,
Is g++ readfile.cc -f filename possible ?
You mean provide command line switches for your program to the compiler?
That's not very useful, is it? The command line switches are supposed to be
passed on execution of your program. For interpreted languages, that's the
same time the interpreter is run, but not for compiled languages. So when
you run you program, you can do:
../readfile -f filename
If you want to provide something to the compiler that can be used in your
program, you can use a macro. Most compilers provide a command line switch
to define macros. In GCC, it would be -D, so you can do:
g++ readfile.cc -DFILENAME=filename
then you can use FILENAME within your program to refer to filename.