Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- char *no_space(char *);
- int main(void) {
- char *strin = "HELLO WORLD";
- printf("%s\n", strin);
- printf("%s\n", no_space(strin));
- return 0;
- }
- char *no_space(char *strin){
- int i = 0, c = 0;
- for ( ; strin [i] ; i++ ){
- if ( strin[i] != ' ' )
- strin[c++] = strin[i];
- }
- strin[c]= '\0';
- return strin;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement