0001仕様書無しさん
2015/06/16(火) 18:14:20.10どこをどうすればいいか教えてください
#include <stdio.h>
main() {
char text, c, *pc;
int i;
printf("文字列を入力してください");
scanf("%s", text);
printf("検索する文字列を1文字入力してください");
scanf("%c%*[^n]%*c", &c);
pc = &text;
while(*pc != '\0') {
pc++;
i++;
if (*pc == c)
printf("%cは前から%d番目に存在します\n", c, i);
return(0);
}
printf("存在しません\n");
}
こうすると二つ目のscanfが実行された後にenter押しても次に進まないです。
どうすればいいですか。