失踪原型错误 [英] missing prototype error

查看:246
本文介绍了失踪原型错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我得到一个错误,我不明白,不能找到一个解决方案。

I'm getting an error I don't understand and can't find a solution.

的错误是如下:

失踪原型isANumber

missing prototype for isANumber

在code指的是:

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>

任何帮助将是AP preciated:)

Any help would be appreciated :)

推荐答案

您不能转发引用。需要声明或定义 isANumber 之前,你可以参考一下吧:

You can't forward reference like that. You need to declare or define isANumber before you can reference it:

提示函数之前将这个:

int isANumber(char *check);

这篇关于失踪原型错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆