Xiang
04-26-2003, 07:58 PM
Dear sir,
Refers to the below coding. In my input condition, I want to able the cursor move arround the name and do the amendment. How can I do??? I have try gets function before, but it does't work.
For example,
If user has entered "Dsvid Jackson", he want to amend the second character "s" to "a". If I used scanf function, it will erase other characters until the "s" location is meet. How can I enable the cursor move to the "s" location to do the amendment and also retain the other characters.
char name[10];
printf("Enter your name: ");
scanf("%s", name);
printf("%s", name);
Best regards,
Xiang
Refers to the below coding. In my input condition, I want to able the cursor move arround the name and do the amendment. How can I do??? I have try gets function before, but it does't work.
For example,
If user has entered "Dsvid Jackson", he want to amend the second character "s" to "a". If I used scanf function, it will erase other characters until the "s" location is meet. How can I enable the cursor move to the "s" location to do the amendment and also retain the other characters.
char name[10];
printf("Enter your name: ");
scanf("%s", name);
printf("%s", name);
Best regards,
Xiang