//已经在WIN-TC上验证。#include<stdio.h>intmain(){char*strcut(char*,int);charstr[]="abcdefg";printf("%s",strcut(str,3));getch();}char*strcut(charstr[],intm){intp=0;while(str[p++])//计算字符串STR的长度。{}p-=1;if(m<p&&m>=0)//验证m的值是否合法。return&str[p-m];elsereturn&str[p];}