【发布时间】:2015-05-17 19:39:27
【问题描述】:
我是从用户打印字符串到屏幕的托盘当用户插入(输入)键时我遇到的问题程序转到新行并且用户仍然可以在屏幕上打印,但是当我插入时(输入)程序转到第一行并覆盖旧单词这是我的代码
#include <stdio.h>
#include <stdlib.h>
#include<string.h>
int main()
{
int len;
char searsh_word[10];
char ch;
printf("enter your strings\n");
while(ch!='EOF'){
ch=getch();
printf("%c",ch);
}
puts("\nEnter the word you need to search for : ");
scanf("%s",searsh_word);
len=strlen(searsh_word);
printf("your word length is : %d",len);
return 0;
}
【问题讨论】: