好的,所以我一直在努力应对路面问题,试图弄清楚确切省略了什么参数名称。这是我从构建消息中得到的唯一错误,警告或注意。

线

void readTickets(struct tickets_s, int earlyTix, int doorTix) {


作为...的一部分

#include <stdio.h>
#include <string.h>
#include <math.h>

//Establishing maximum size of array values
#define MAXSIZE 100
#define NUMDRINKS 10
#define MAXPRIZES 100
#define MAXGUESTS 1000
#define MAXRAFFLE 100000

//Establishing struct related to variables for tickets to the ball
struct tickets_s {
    double prePrice;
    double doorPrice;
    double guests[MAXGUESTS];
    int totalTix;
};

//Establishing struct for drink variables
struct drinks_s {
    int drinks[NUMDRINKS];
    double drinkPrices[NUMDRINKS];
};

//Establishing struct for variables related to the raffle
struct raffle_s {
    int raffleGuests[MAXRAFFLE];
    int prizeCount[MAXPRIZES];
    double itemValue[MAXPRIZES];
    double rafflePrice;
};

//Vars for amount of pre-sale tickets, door sale tickets and the totals for drinks, raffle and revenue
FILE* ifp;
int earlyTix, doorTix;
double totalDrinks;
double totalRaffle;
double totalRevenue;

//Renaming structs
struct tickets_s tickets;
struct drinks_s drinks;
struct raffle_s raffle;

void readTickets(struct tickets_s, int earlyTix, int doorTix);

int main() {

    char fileName[MAXSIZE];

    printf("Enter the name of the input file (including file extension)\n");
    scanf("%s", fileName);

    fopen(fileName, "r");
    readTickets(tickets,earlyTix,doorTix);

}

void readTickets(struct tickets_s, int earlyTix, int doorTix) {

    fscanf(ifp, "%d%d", &tickets.prePrice, &tickets.doorPrice);
}


我不知道该参数名称省略了什么。 struct参数在那里。专有名称已被使用。我的编译器整天都很时髦,这只是副作用吗?

另外,由于某种原因,我无法在函数中传递“ ifp”作为参数,因此可以从所述函数的输入文件中读取数据。我一直在努力使它也能正常工作,但是我什么也没做。

最佳答案

评论员AlexD帮我解决了一个我忽略的愚蠢错误。谢谢亚历克斯。

“您的意思是说无效的readTickets(struct tickets_s TICKETS,int earlyTix,int doorTix)吗?-AlexD”

10-07 19:28
查看更多