hamaXD

Final 58 removeChar

Dec 8th, 2016
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.32 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<string.h>
  3.  
  4. void delete(char x[],char c){
  5.     int size = strlen(x);
  6.     int i=0,j=0;;
  7.     char p[size];
  8.     while(i<size){
  9.         if(x[i]!=c){
  10.             p[j]=x[i];
  11.             j++;
  12.         }
  13.        
  14.         i++;
  15.     }
  16.    
  17.     printf(p);
  18.  
  19. }
  20. int main(){
  21.     char c;
  22.     char u[50];
  23.     gets(u);
  24.     scanf("%c",&c);
  25.     delete(u,c);
  26.    
  27.    
  28.    
  29.     return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment