程序代码:
#include<stdio.h>
#define max 256
int main(void)
{
char s1[max]={'\0'};
char s2[max]={'\0'};
int m;
gets(s1);
printf("请输入m值:");
scanf("%d",&m);
char* p1=s1;
char* p2=s2;
p1+=m;
while(*p1!='\0')
{
*p2++=*p1++;
}
printf("截取m后 字符串为%s\n",s2);
return 0;
}