char *substring(char *text, int position, int length)
{
int i, j=0;
char *temp ;
for(i=position-1; i<position+length-1; i++)
{
temp[j++] = text[i];
}
temp[j] = '\0';
return temp;
}
Run Code Online (Sandbox Code Playgroud)
嗨以下代码中的错误是什么..我试图在Fedora机器上运行它..它给我一个运行时错误"分段错误".什么是这个错误..为什么它会给出这个错误..
谢谢..
归档时间: |
|
查看次数: |
787 次 |
最近记录: |