Hi all,
I am having a strange problem when I run the scanf. The following is my code:
The target DNA sequence can be entered. But the program stops as soon as I enter the sequence.
Could anyone give me a hint why this happens?
Thx.
I am having a strange problem when I run the scanf. The following is my code:
Code:
int main(int argc, char** argv){
int result;
char* Y = (char*)malloc(sizeof(char)*MAXLENGTH);
printf("Enter the target DNA sequence :");
result = scanf_s("%c",&Y);
if(result == EOF){
printf("Read no character.\n");
return 1;
}
char* X = (char*)malloc(sizeof(char)*MAXLENGTH);
printf("\nEnter the query DNA sequence :");
result = scanf_s("%c",&X);
printf("\n");
if(result == EOF){
printf("Read no character.\n");
return 1;
}
runSW(X,Y);
CUT_EXIT(argc, argv);
}
Could anyone give me a hint why this happens?
Thx.
Comment