面试笔试题(2)

1. 

#include <iostream>

using namespace std;

int main()
{
    int i = 0;
    int j = 0;
    if(i ++ == ++ j)
    {
        cout << "i," << i << "j," << j << endl;
    }
    else
    {
        cout << "不相等" << endl;
       cout << "i," << i << "j," << j << endl;
    }
    return 0;
}

  2.   宏定义实现求数组个数

#define SIZE_ARRAY(a) (sizeof(a)/sizeof(a[0]))

int a[10] = {1,2,3,4,5,6,7,8,9,0};

    int k = SIZE_ARRAY(a);

posted @ 2011-09-26 21:35  wtx  阅读(377)  评论(0编辑  收藏  举报