View Code of Problem 55

#include <stdio.h>
int main(){
	
  int i;
  char str1[100];
  char str2[100];
  gets(str1);
  char c;
  scanf("%c",&c);
  for(i=0;str1[i] != c;i++){
  	str2[j++] = str1[i];
  
  }
  puts(str2);



}
/*
Main.c: In function 'main':
Main.c:7:3: warning: 'gets' is deprecated (declared at /usr/include/stdio.h:638) [-Wdeprecated-declarations]
   gets(str1);
   ^
Main.c:11:9: error: 'j' undeclared (first use in this function)
    str2[j++] = str1[i];
         ^
Main.c:11:9: note: each undeclared identifier is reported only once for each function it appears in
*/

Double click to view unformatted code.


Back to problem 55