On Tue, 25 Mar 2008 01:06:49 GMT, "Bill Cunningham" <no****@nspam.com>
wrote:
Since I've been told that char *argv[] or char **argv[] must be the
I doubt if anyone has suggested the second form. If they have, you
have just learned an important Usenet lesson: some advice is wrong.
More likely, however, is the lesson that in programming you need to
pay more attention to the details. The second form of this parameter
is char** argv. The difference is not irrelevant...
>second parameter to main's command line structure I have turned to strtod( )
but can't get it to work so far. This function is probably used alot but I
obviously am not using it right.
#include <stdio.h>
int main(int argc, char **argv) {
But apparently you knew the correct form. So maybe your opening
sentence was sucker bait and you hooked me.
if (argc != 3) {
fprintf(stderr,"usage error");
You have been here for a while. How many times have you seen messages
discussing the potential problems caused by not including a \n at the
end of the string to be displayed?
}
strtod(argv[1],(char**);
You might want to spend some time learning to balance your
parentheses.
You might also want to practice indenting consistently. Code that
easier to read is easier to debug.
When you look up a function in your reference, it should also tell you
which headers you need to include to use that function. That
information is not superfluous.
strtod(argv[2],(char**);
printf("%f"argcv[1],"divided by ","%f",argv[2]," is
",argv[1]/argv[2]);
This is just mind boggling. Do you really think you can just ignore
the function prototypes? Do you really think that placing arguments
adjacent to each other with no intervening punctuation will magically
convert and concatenate values? Do you really think two conversion
specifications are adequate for printing at least three variable
values?
>}
Where is the int that main is supposed to return?
>
This is one of many tried of strtod( ) I've tried on my own.
Forget strtod. Try to get main correct first.
Remove del for email