fork download
  1. #include <stdio.h>
  2. char *no_space(char *);
  3.  
  4. int main(void) {
  5.  
  6. char strin[] = "HELLO WORLD";
  7.  
  8. printf("%s\n", strin);
  9. printf("%s\n", no_space(strin));
  10.  
  11. return 0;
  12. }
  13.  
  14. char *no_space(char *strin){
  15.  
  16. int i = 0, c = 0;
  17.  
  18. for ( ; strin [i] ; i++ ){
  19.  
  20. if ( strin[i] != ' ' )
  21.  
  22. strin[c++] = strin[i];
  23.  
  24. }
  25.  
  26. strin[c]= '\0';
  27.  
  28. return strin;
  29. }
Success #stdin #stdout 0s 4560KB
stdin
Standard input is empty
stdout
HELLO WORLD
HELLOWORLD