Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - Problems of secondary C language
Problems of secondary C language
n = n * 10+argv[I]-' 0 ';

This should be argv[i][0], right?

Argv[i] is a pointer. Who knows what the pointer address is

If it is n = n *10+argv [I] [0]-0; The answer is 136.

Because three parameters were entered during the execution: 12 345 678.

These three parameters are input as strings to argv [1], argv [2] and argv [3].

So argv[i][0] are' 1' '3' '6' respectively.

Then the calculation of n is simple. The first cycle is n = 1, the second cycle is n = 13, and the third cycle is n = 136. Each calculation will multiply the previous n by 10, and add the difference between argv[i][0] and' 0'.