Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //main.c
- #include<stdio.h>
- #include<string.h>
- char* find_space(char *s);
- int main(){
- int i=0,len =0;
- char s[100],ch,copy[100],cc,*null=NULL;
- gets(copy); fflush(stdin);
- scanf("%c",&cc);
- len = strlen(copy);
- while(i<len){
- printf("%c\n",copy[i]);
- if(find_space(©[i]) != NULL){
- copy[i] = cc;
- }
- printf("%c\n",copy[i]);
- i++;
- }
- printf("\n");
- printf(copy);
- return 0;
- }
- char* find_space(char *s){
- printf("in f = %c\n",*s);
- char *null=NULL;
- if(*s == ' ') {
- printf("in if\n");
- return s;
- }else{
- printf("in else\n");
- return null;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement