I am having a strange problem when I run the scanf. The following is my code:
Expand|Select|Wrap|Line Numbers
- 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.