#include
#include
#define MAX_LENGTH 32
int main()
{
char str[MAX_LENGTH] = {0};
char *pStr = (char*)&str;
//1. 将字符串computer赋给一个字符数组
strcpy(str, "computer");
//2. 然后从第一个字母开始间隔地输出该串
while(*pStr != '\0' )
{
printf("%c\n", *pStr);
pStr++;
}
return 1;
}
#include
using namespace std;
int main()
{
char* str="computer";
char* p=str;
cout<
{
cout<<*p<<" ";
p=p+2;
}
return 0;
}
#include
#include
#define N 100
int main()
{
char a[N] = {0};
char *p= a;
strcpy(p, "computer");
while(*p!= '\0' )
{
printf("%c ", *p);
p++;
}
printf("\n");
return 0;
}
#include "stdio.h"
void main()
{
char a[100];
char* computer="my string";
strcpy(a,computer);
int i=0;
while(*a!="\0")
printf("%c ", *a++);
printf("\n");
}
#include
#include
{
int i;
char a[81]=''computer'';
char * p=a;
while(*p!='\0')
{
printf("%s",*p);
p++;
}
printf("\n");
}