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??
---------------------------------------------------------------------------------------------------------------
Note - i have set argc and argv through -
project properties -> Confugeration Properties -> Debugging -> Command
arguments ->
for case 1 here i wrote - 4, "ashish"
for case 2 here i wrote - 4
any explanation why argc value changes and why **argv is f?
---------------------------------
Why delete messages? Unlimited storage is just a click away.
[Non-text portions of this message have been removed]