这个转换莫尔斯密码的有啥问题
程序代码:#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int main(int argc, char *argv[]) {
int input_str_len,i,cache;
char morse_code[400] = {'\0'};
char input_str[100] = {'\0'};
char morse[26][5] = {".-","-...","-.-.","-..",".","..-.","--.",
"....","..",".---","-.-",".-..","--","-.",
"---",".--.","--.-",".-.","...","-","..-",
"...-",".--","-..-","-.--","--.."};
gets(input_str);
input_str_len = strlen(input_str);
for (i = 0;i < input_str_len; i++){
if ((cache = input_str[i]) >= 'A' && cache <= 'Z' ){
morse_code = strcat(morse_code,morse[input_str[i] - 'A']);
} else if (cache == '_'){
morse_code = strcat(morse_code,"..--");
} else if (cache == '.'){
morse_code = strcat(morse_code,"---.");
} else if (cache == ','){
morse_code = strcat(morse_code,".-.-");
} else {
morse_code = strcat(morse_code,"----");
}
}
printf("%s",morse_code);
return 0;
}








求帮忙

我晕了
