| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | ..ARGV |
Hi,
KH>> I was accessing varibles of the seperate argv's by using *(*
PE>and KH>> found that if I did a plain argv++ it would only goto the nex
PE>character KH>> in argv, not the next array element...
If you had "(*argv)++" it would explain that.
[stuff deleted]
KH> *(argv++); /* if I replace this with argv++ it doesn't work
KH> /* btw, this it the line it gives the warning on
The deference doesn't do anything in this case - it *should* be exactly the
same as putting "argv++".
[more stuff deleted]
Try this:
/* ------------------ */
#include
#include
int main (int argc, char *argv[])
{
int i;
/* This... */
for (i = 0; i < argc; ++i)
puts (argv[i]);
/* ... does the same as this. */
while (argc--)
puts (*argv++);
return EXIT_SUCCESS;
}
/* ------------------ */
The above should work. Argv[0] is the name of the program you are
executing - I think this is guaranteed in the Ansi standard.
Hope this helps! Got any other problems I can help with?
Glen C.
---
* WR 1.31 [NR] * UNREGISTERED EVALUATION COPY
--- TMail v1.31.5
* Origin: adam.com.au 64 lines all 300 to 28k (08) 370 5775 (3:800/805)SEEN-BY: 50/99 620/243 623/630 711/401 409 410 413 430 510 808 809 932 934 SEEN-BY: 712/515 713/888 714/906 800/1 2 430 432 805 806 809 810 812 814 822 SEEN-BY: 800/831 841 843 846 7877/2809 @PATH: 800/805 1 711/808 809 934 |
|
| SOURCE: echomail via fidonet.ozzmosis.com | |
Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.