#include
char *p[] = {"to","yes","is ok","how do you do ?","holle"};
int main(int argc,char* argv[])
{
int a[5] = {0};
int i = 0;
int j = 0;
char ** t;
t = p;
for(i = 0; i<5;i++)
{
printf("%x \t",p[i]);
}
for(i = 0; i<5; i++)
{
while( *t[i] != '\0')
{
t[i]++;
a[i]++;
}
}
for(i =0 ;i<5;i++)
{
printf("%d \n",a[i]);
}
for(i = 0; i<5;i++)
{
printf("%x \t",p[i]);
}
return 0;
}
#include<stdio.h>
char *p[] = {"to","yes","is ok","how do you do ?","holle"};
int main(int argc,char* argv[])
{
int a[5] = {0};
int i = 0;
int j = 0;
char * t;//修改
for(i = 0; i<5;i++)
{
printf("%x \t",p[i]);
}
printf("\n");
for(i = 0; i<5; i++)
{
t=p[i];//修改
while( *t != '\0')//修改
{
t++;//修改
a[i]++;
}
}
for(i =0 ;i<5;i++)
{
printf("%d \n",a[i]);
}
for(i = 0; i<5;i++)
{
printf("%x \t",p[i]);
}
printf("\n");
return 0;
}