こんにちは、Turbo C を使用しています...ちょっと質問があります。本で TC のコードを見つけましたが、説明に満足していません。コードは次のとおりです。
main()
{
int count = -1; /* why it was initialized as -1? */
char ch;
printf("Type in a phrase:\n");
ch = 'a'; /* why it was initialized as 'a'? */
while (ch != '\r') /* perform while ch is not equal to return */
{
ch = getche();
count++; /* increment the count */
}
printf("\nCharacter count is %d", count); /* prints the value of count */
}
前もって感謝します!