c语言指向结构体数组的指针

 #include <stdio.h>
#include <stdlib.h> struct dangdang
{
char email[];
char name[];
char addr[];
int num;
int bugnum;
char tel[];
char phone[];
double RMB; }dbdd[]={{"1171546435@qq.com","lj","重庆市",,,"","",},
{"453454534@qq.com","fd","贵阳",,,"","",}
};

//访问数组
void main3()
{
int a[]={,,,,};
int *p;
for(p=a;p>a+;p++)//p++根据类型增加 一次增加四个字节
{
printf("%d%x",*p,p);
}
} void main4()
{
struct dangdang *p;
for(p=dbdd;p<dbdd+;p++)
{
//两种方式
printf("\nname=%s,addr=%s,phone=%s",p->name,p->addr,p->phone);
printf("\nname=%s,addr=%s,phone=%s",(*p).name,(*p).addr,(*p).phone);
} getchar();
}
上一篇:MySQL 字符集问题及安全的更新操作


下一篇:CheckBoxList1复选框