#include <stdio.h> #include <iostream.h> int qq(int x,int y) { return x*y; }
void main() { int k=7; cout<<qq(k++,++k)<<endl; }
#include <stdio.h>
#include <iostream.h>
int qq(int x,int y,int z,int p)
{
cout<<x<<endl;
cout<<y<<endl;
cout<<z<<endl;
cout<<p<<endl;
return x*y*z*p;
}
void main()
{
int k=2;
cout<<qq(++k,++k,++k,++k);
cout<<endl;
cout<<k;
}
分析:表达式分析(k++,++k) 因为VC是从右往左编译的,所以先计算++k ,然后才是k++
(++k,++k,++k,++k) 也是先从右往左编译。 注:这种表达式和编译环境有关。 -电子元器件采购网(www.ruidan.com)是本土元器件目录分销商,采用“小批量、现货、样品”销售模式,致力于满足客户多型号、高质量、快速交付的采购需求。 自建高效智能仓储,拥有自营库存超过50,000种,提供一站式正品现货采购、个性化解决方案、选型替代等多元化服务。