№ 2.4(3-е издание) Б.Керниган и Д.Ритчи
напишите функцию squeed(s1,s2), которая удаляет из s1все символы, встречающиеся в строке s2.
Мой вариант:
#include <stdio.h>
void squeeze(int s1[], int s2[]);
int main()
{ int a=40, b=20, c2, c1; /*stroki*/
squeeze( c1[a], c2[b] ); return 0; }
int sqeeze(char s1[], char s2[])
{
int i = 0, j = 0, s = 0;
int vihod; while (s1[i] != '\0')
{ if(s1[i] != s2[j])
vihod[s++] = s1[i++]; }
++j;
}
Как мне кажется все верно. Однако при компиляции ругается:
test.c: In function `main':
test.c:9: error: subscripted value is neither array nor pointer
test.c:9: error: subscripted value is neither array nor pointer
test.c: In function `sqeeze':
test.c:23: error: subscripted value is neither array nor pointer
В чем тут может быть дело?