argc is the number of strings in the argv array. argv[0] is always the name of the executable program and will never ever contain a command-line argument.
>>argv[i] + 3
all that does is bypass the first 3 characters of the ith string.
The algorithm you posted doesn't work at all if you put a space between "/id" and whatever is supposed to follow. For example, if you typed this:
c:\myprogram /id something <Enter key>
In the above the program will get two command-line arguments, not one. argv[1] will be "/cd" and argv[2] will be "something". And that will break the algorithm you posted.
Ancient Dragon
Retired & Loving It
30,050 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
It will work for the arguments you posted, but not for this
c:\myprogram /id TheAdminId /pw TheAdminPw
Ancient Dragon
Retired & Loving It
30,050 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343