I am writing this simple code for checking if the user has entered the key or not. If not I want to return 1 and show an error msg. Below is the snapshot of my code which I am using. I am getting the following error. I will appreciate your help on the same. Thank You.

enter image description here


It's quite literally what it says. First, understand that all warnings are treated as errors because of one of the flags in the compile statement. This would otherwise just be a warning.

Now to the real issue. It literally means that the var argv[] is not being used anywhere in the program. If you were to do anything with the input vars, like print them for instance, this error would disappear.

It would be the same as declaring int foo; in the program and never doing anything with foo after that.

If this answers your question, please click on the check mark to accept. Let's keep up on forum maintenance. ;-)


I concur with Cliff B explanation to the problem. In order to resolve the error,there are two ways forward :

1.You can either remove the parameter from the main (which will not fulfill the specification of the problem set)

2.Use the argv array or some of its element somewhere in the program inside the main code.For that you should know the values in the argv[] array. That is enough hint ,i guess.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .