Hi, This is my first posting to this forum. I have been reading it for a couple of weeks and have learned a great deal. I have just started learnging C in college and am currently taking a class. I am stuck on the current problem that we have. Well, I am stuck on part of the problem. I searched the board and could not find an answer. Here it is. I am writing a program that figures gas consumption at a pay at a pump terminal. Part of the program is to enter the current gas price as a command line arguement when the program is initialised. I have to prompt the user for the gas price if the user does not put it in. I have written code but that part of the program seems to be ignored. The rest of the program works perfectly except for this part about what happens if the user does not put in the price. Here is what I have:
<code>
int main(int argc, char *argv[])
{
int a;
if (argc < 0)
{
printf("Please input the current gas price per gallon: ");
scanf("%s", argv[a])
}
return 0;
}
</code>
This isn't all of the code for the program. I am at work and can't access it right now. If you need the whole program, I will post it tonight.
Thanks