pointer to int error

B

Bill Cunningham

Stefan Ram said:
I see. I believe the solution to your problem is to use
»argc« also for the comparison with »4«, just as you used
it in the comparison with »1«.

I have been doing something like what you mention for some time with
argv[]. As I said I've never used argc until now. But at the moment I can't
remember how I've been using argv[] like this so I will have to look at some
old code. I have also had to stop driving lately because of getting lost. I
now ride the bus. I'm hoping *if* I ever get to .5 mg of klonopin ter in die
instead of 1 mg I can drive again.

Bill
 
K

Keith Thompson

Bill Cunningham said:
Cyber-stalkers

Not really. Your Usenet posts are public; you have no valid
grounds for complaint if people read them. And if you really were
exhibiting a reasonable learning curve in other newsgroups, that
would be evidence that your posts here are deliberate trolling,
which is relevant to the question of how we should respond to you.

But as I said, I didn't see much difference. My working hypothesis
is still that you're sincere, but I frankly don't see much hope that
you'll benefit from the advice you receive here. (I don't say that
lightly. I've been reading your posts here for several years.)
 
K

Keith Thompson

Bill Cunningham said:
Stefan Ram said:
I see. I believe the solution to your problem is to use
»argc« also for the comparison with »4«, just as you used
it in the comparison with »1«.

I have been doing something like what you mention for some time with
argv[]. As I said I've never used argc until now.
[snip]

Incorrect. Here's a program you posted here on 2009-02-22, in which
you used argc (and correctly).

#include <stdio.h>
#include <stdlib.h>

int main(int argc, char **argv)
{
if (argc != 2) {
puts("hex usage error");
exit(EXIT_FAILURE);
}
int x = strtol(argv[1], NULL, 10);
printf("%i\n", x);
return 0;
}
 
B

Bill Cunningham

Incorrect. Here's a program you posted here on 2009-02-22, in which
you used argc (and correctly).

#include <stdio.h>
#include <stdlib.h>

int main(int argc, char **argv)
{
if (argc != 2) {
puts("hex usage error");
exit(EXIT_FAILURE);
}
int x = strtol(argv[1], NULL, 10);
printf("%i\n", x);
return 0;
}

That's what I've been doing Stefan if you're still here. I'm sorry Kieth
yes that's it.
 
B

Bill Cunningham

[snip]

But as I said, I didn't see much difference. My working hypothesis
is still that you're sincere, but I frankly don't see much hope that
you'll benefit from the advice you receive here. (I don't say that
lightly. I've been reading your posts here for several years.)

I am not a professional either. There may be programmers here that have
use C for most of their lives annd I chose C about the time I began posting.
I have learned alot and have even more to learn I know that just by looking
at other's posts. Thee is still much that surprises me when I come across
pointer arithmetic. There are functions and macros I can't begin to explain
that I know exist. Headers in C89 I've never used and in C99 certainly I
haven't used. I couldn't begin macro expansion.

Bill
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,778
Messages
2,569,605
Members
45,238
Latest member
Top CryptoPodcasts

Latest Threads

Top