これは私のコード内の関数であり、カウント ループが私のプログラムを壊す原因であることは確かです。
最初の print ステートメントは、コード内で以前に設定された番号を返しますが、次の print ステートメントを出力することはありませんhello
。
なぜうまくいかないのかわかりません。誰かが私を助けることができますか?
//Function Declaration
int calc_digits(int number)
{
//Local Declaration
int count = 0; // the times the loop has ran
printf("%d", number);
fflush(stdout);
while (number != 0);
{
number /= 10;
count++;
}
printf("hello");
fflush(stdout);
return(count);
}