标签:
1 #include<iostream> 2 #include<ctime> 3 #include <stdio.h> 4 #include<cstring> 5 #include<cstdlib> 6 #include <map> 7 #include <string> 8 #if 1 9 using namespace std; 10 struct product{ 11 int x; 12 char buf[33]; 13 }STPRODUCT[1000]; 14 int main(){ 15 struct product pt[] = {{2,"qwert"},{5,"asdfg"}}; 16 struct product *p = pt; 17 p++; 18 printf("%d %s\n",p->x, (*p).buf); 19 printf("%d %s\n",pt[0].x, (*pt).buf); 20 /*数组名为常量指针。不能++ 21 pt++;//error 22 printf("%d\n",(*pt).x); 23 */ 24 } 25 #endif
标签:
原文地址:http://www.cnblogs.com/guxuanqing/p/5851424.html