我收到一個錯誤,我不明白並找不到解決方案。缺少原型錯誤
的錯誤如下:
失蹤原型isANumber
代碼它指的是:
double prompt(char *promptString) {
printf("%s", promptString);
char *input = "";
scanf("%s", &*input);
printf("%s\n", &*input);
int check = isANumber(input);
if (check) {
return (double) *input;
} else {
return 0.00;
}
}
int isANumber(char *check) {
int result = 0; /* Current isdigit() return value */
do /* Check that each character of the...*/
result = isdigit(*check++); /* ...string is a digit and move on...*/
while (result && *check); /* ...until non-digit found or at EOS */
return result; /* Return result of last isdigit() call */
}
庫包括:
#include <stdio.h>
#include <limits.h>
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
任何幫助將是讚賞:)
感謝,瞬間固定:) – Graham