problem passing an option as command line argument

This is a discussion on problem passing an option as command line argument within the C Programming forums, part of the General Programming Boards category; This program reads a file given as command line argument
and outputs all the lines in the file that contain ...

problem passing an option as command line argument

This program reads a file given as command line argument
and outputs all the lines in the file that contain the
sequence of characters WORD. WORD is passed in as command line argument. I added an option to this code where the user can chose to have the line number written out as well. The option is indicated by a command line argument -n. But when i use this option it keeps telling me that am passing a wrong parameter.IS there a reason why it doesnt recognise "-n" as a string?