Tag: 减量

pre decrement vs. post decrement

我什么时候应该使用预减量以及何时使用减量? 对于以下代码片段,我应该使用前或后减量。 static private void function(int number) { charArr = new char[number]; int i = 0; int tempCounter; int j = 0; while(charrArr!=someCharArr) { tempCounter = number – 1; password[tempCounter] = element[i%element.Length]; i++; //This is the loop the I want to use the decrementing in. //Suppose I have a char array of size 5, the […]