#include <iostream>
using namespace std;
int main()
{
int a[4]={2,4,6};
int y=0,*p=a;
for(;*p++;)
if(*p)
y+=*p;
cout << y;
}
p指向a[0],p++,就是p指向下一个位置a[1] 再取值为4 for循环判断4不等于0 if 判断 4不等于0 y加4,然后p++移到下一个位置a[2],取值为6 for循环判断6不等于0 if 判断 6不等于0 y加6
最后结果为10