I want to collect all alphabets from a string like `a,c,e,f`and put them in another string `acef`. I got a messed up result, `acef■   ┌sa,c,e,f`. Here's my code: 

```
#include <stdio.h>
#include <string.h>

int main() {
    int i,j=0;
    char str[10];
    strcpy(str,"a,c,e,f");
    char tmp[10];
    for(i=0;i<strlen(str);i++) {
        if(str[i]==',') {
            continue;
        }
        else {
            tmp[j++]=str[i];
       }
    }
    printf(" %s",tmp);
    return 0;
}

```