小编hca*_*cas的帖子

C ++标识符未定义

我是C ++的新手,我不明白为什么会收到此错误。在5个类似3标记错误的语句中,其他两个都可以。错误在主要功能上。

    #include <iostream>
using namespace std;

// Function declaration
void getGallons(int wall);
void getHours(int gallons);
void getCostpaint(int gallons, int pricePaint);
void getLaborcharges(int hours);
void getTotalcost(int costPaint, int laborCharges);

// Function definition
void getGallons(int wall)
{
    int gallons;

    gallons = wall / 112;

    cout << "Number of gallons of paint required: " << gallons << endl;


}

// Function definition
void getHours(int gallons)
{
    int hours;

    hours = gallons * 8;

    cout << "Hours of labor required: " << hours …
Run Code Online (Sandbox Code Playgroud)

c++ variables parameters undefined identifier

2
推荐指数
1
解决办法
69
查看次数

标签 统计

c++ ×1

identifier ×1

parameters ×1

undefined ×1

variables ×1