Mail Archives: djgpp/1999/06/28/19:41:40
On Mon, 28 Jun 1999, you wrote:
> Why doesn't this work?
>
> #include <iostream.h>
>
> int main(int argc, char argv[])
> {
> int loop;
> for(loop = 0; loop < argc; loop++)
> {
> cout<<"argv["<<loop<<"]: "<<argv[loop]<<endl;
> }
> return 0;
> }
>
> Thanks,
> Tom Beauchamp
#include <iostream.h>
int main(int argc, char *argv[]) // you need to put a star net to argv[] (*)
{
int loop;
for(loop = 0; loop < argc; loop++)
{
cout<<"argv["<<loop<<"]: "<<argv[loop]<<endl;
}
return 0;
}
this will work you just need that one charicter
- Raw text -