#include<stdio.h> #include<string.h> int main() { int i,n; char str[n],c; gets(str); scanf("%c",&c); for(i=0;i<n;i++) { if(str[i]==c) str[i]=str[i+1]; printf("%c",str[i]); } return 0; } /* Main.c: In function 'main': Main.c:7:3: warning: 'gets' is deprecated (declared at /usr/include/stdio.h:638) [-Wdeprecated-declarations] gets(str); ^ Main.c:12:14: error: 'stri' undeclared (first use in this function) str[i]=stri+1]; ^ Main.c:12:14: note: each undeclared identifier is reported only once for each function it appears in Main.c:12:20: error: expected ';' before ']' token str[i]=stri+1]; ^ Main.c:12:20: error: expected statement before ']' token */ |
Double click to view unformatted code.