(increment operator)递增运算符(++),(decremen operator)递减运算符(--),的应用范围很广,很多的编程语言都有该内容,(increment operator)递增运算符(++),就是将其运算对象递增加一,而(decremen operator)递减运算符(--)则反之。这两种运算符都有两种方式,其一:(++)或者(--)出现在作用变量前面,例如:--a,++a。其二:(++)或者(--)出现在作用变量的后面,例如:a--,a++。前者称为前缀模式,后者称为后缀模式,那么它们之间又是如何运行工作的呢?请看下面的文章内容。
代码案例一:
#include <stdio.h>
#include <stdlib.h>
#define MXA 100
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int main(void) {
int count = MXA + 1;
while(--count > 0){
printf("%d bottles of spring water on the wall.""%d bottles of spring water!\n",count,count)