S
Shastri
Hi all,
I was trying to implement chmod command(UNIX) in c. While passing
arguments to the main function like :
-r for reading the file
-w for writing the file
How can I compare the second argument i.e argv[1] with something like
-r?
While running the program if I enter -r it should read the file.
So if(argv[1]=='-r') can't be done as we cant compare a pointer to an
integer. so Please suggest how to do this??
Thanks
Shastri
I was trying to implement chmod command(UNIX) in c. While passing
arguments to the main function like :
-r for reading the file
-w for writing the file
How can I compare the second argument i.e argv[1] with something like
-r?
While running the program if I enter -r it should read the file.
So if(argv[1]=='-r') can't be done as we cant compare a pointer to an
integer. so Please suggest how to do this??
Thanks
Shastri