Tag: 查找 发生

如何修复分段错误11错误?

我希望main返回“dati”中出现“mdl”的位置。 我设置“schema”函数来查找每次出现的起点,但是当我从命令行运行程序时,它返回: Segmentation fault: 11 我不知道如何解决这个问题。 这是代码: #include #include #include #include int schema(int testo[], int nT, int modello[], int nM, int primo) { int i, j, k; static int r[12]; j=0; for(i=primo; i<nT; i++) { if(testo[i] == modello[0] && testo[i+1] == modello[1] && testo[i+2] == modello[2] && testo[i+3] == modello[3] && testo[i+4] == modello[4] && […]