--- In [email protected], ashish sarode <[EMAIL PROTECTED]> wrote:
>
> Hello,
>    
>   I have written following code (in visual studio 2005)
>    
>   #include <iostream>
>   using namespace std;
>   int main(int argc, char **argv)
>   {
>   for(; (!!argc); --argc)
>       cout << (**argv) << endl;
>   return 0;
>   }
>    
>   when i pass argc as 1 and argv as ashish - f is printed 3 times on
the console window
>    
>   f
> f
> f
>    
>   Here value of argc is 3 and value of argv is "f"
>  
---------------------------------------------------------------------------------------------------------------
>    
>   when i pass only 4 as the argument i get following result
>    
>   f
> f
>    
>   Here value of argc is 2 and value of argv is "f"
>    
>  
---------------------------------------------------------------------------------------------------------------
>    
>   Could anybody tell me reason behind this??
>    
>  
---------------------------------------------------------------------------------------------------------------
Hey,
  Try printing out argc and *argv in each case. You should get your
answer. 

Have fun
~Saurabh

Reply via email to