#include<stdio.h> #include<string.h> int main(){ char str[100]; gets(str); for(int i=0;i<strlen(str)-1;i++){ scanf("%c",stri]); printf(" "); } printf("%c",str[strlen(str)-1]); } /* Main.c: In function 'main': Main.c:5:1: warning: 'gets' is deprecated [-Wdeprecated-declarations] gets(str); ^~~~ In file included from Main.c:1: /usr/include/stdio.h:583:14: note: declared here extern char *gets (char *__s) __wur __attribute_deprecated__; ^~~~ Main.c:7:16: error: 'stri' undeclared (first use in this function); did you mean 'str'? scanf("%c",stri]); ^~~~ str Main.c:7:16: note: each undeclared identifier is reported only once for each function it appears in Main.c:7:20: error: expected ')' before ']' token scanf("%c",stri]); ^ ) Main.c:7:20: error: expected ';' before ']' token scanf("%c",stri]); ^ ; Main.c:7:20: error: expected statement before ']' token Main.c:7:21: error: expected statement before ')' token scanf("%c",stri]); ^ */ |
Double click to view unformatted code.