p108 3.35 3.36

3.35

// 108_335_336.cpp : 定义控制台应用程序的入口点。
//


#include "stdafx.h"
#include
#include
using namespace std;


int main()
{
int arr[3] = { 1,1,1 };
int *p = arr;
int *beg = begin(arr);
int *last = end(arr);
while(p {
cout << *p << " ";//要先输出,不然++p后再输出就不是那个数了
p++;
}
cout << endl;
p = arr;//不回去就输不出
while (p {
*p = 0;
cout << *p << " ";//要先输出,不然++p后再输出就不是那个数了
p++;
}
cout << endl;
system("pause");
return 0;
}

3.36



你可能感兴趣的:(p108 3.35 3.36)