gpt4 book ai didi

c - 编译 C 程序时出错

转载 作者:行者123 更新时间:2023-11-30 21:08:16 26 4
gpt4 key购买 nike

我在学校学习 C,我们必须创建一个管理音乐专辑 vector 的程序,我尝试编译但出现此错误,并且我找不到相关信息,编译器错误是:“在 get_parm_info 中,位于 c-decl.c:4637”。

我应该做什么?

这只是一条消息。

代码太长,放不下,但除此之外没有其他错误。

    #include <stdlib.h>
#include <stdio.h>
#include <string.h>
#define MAX_STR 50
#define MAX_CANZONI 20
#define ALBUM_SIZE 44
struct t_canzone { //54 bytes
char titolo[MAX_STR];
int durata; //In secondi
};
struct t_autore { //104 bytes
char nome[MAX_STR];
char cognome[MAX_STR];
int eta;
};
struct t_album {
struct t_autore autore; //104 bytes
char titolo[MAX_STR]; //50 bytes
int numCanzoni; //4 bytes
struct t_canzone canzoni[MAX_CANZONI]; //1080 bytes
};

void inizializzazione(struct t_album album);
void stampacompleta(struct t_album album);
void stampaalbum(struct t_album album,char nome[]);
void cercacanzone(struct t_album album, char nome[]);
void modificaalbum(struct t_album album, char nome[]);
void aggiungicanzone(struct t_album album, char nome[]);
void ordinamento(struct t_album album,void confronto(struct t_album,int,int);
void crescente(struct t_album album,int i,int z);
void decrescente(struct t_album album,int i,int z);
void titlesort(struct t_album album,int i,int z);
void namesort(struct t_album album,int i,int z);

void crescente(struct t_album album,int i,int z){
struct t_album supporto;
if(album[i].numCanzoni>album[z].numCanzoni)
{
supporto=album[i];
album[i]=album[z];
album[z]=supporto;
}
}

void decrescente(struct t_album album,int i,int z){
struct t_album supporto;
if(album[i].numCanzoni<album[z].numCanzoni)
{
supporto=album[i];
album[i]=album[z];
album[z]=supporto;
}
}

void titlesort(struct t_album album,int i,int z){
if(strncmp(album[i].titolo,album[z].titolo)>0)
{
supporto=album[i];
album[i]=album[z];
album[z]=supporto;
}
}

void namesort(struct t_album album,int i,int z){
if(strncmp(album[i].autore.nome,album[z].autore.nome)>0)
{
supporto=album[i];
album[i]=album[z];
album[z]=supporto;
}
else if(strncmp(album[i].autore.nome,album[z].autore.nome)==0)
{
if(strncmp(album[i].autore.cognome,album[z].autore.cognome)>0)
{
supporto=album[i];
album[i]=album[z];
album[z]=supporto;
}
}
}



void ordinamento(struct t_album album,void confronto(struct t_album,int,int){
int i,z;
for(i=0;i<ALBUM_SIZE-1;i++)
{
for(z=i+1;z<ALBUM_SIZE;z++)
{
confronto(album[],i,z);
}
}
}
<小时/>

[评论更新:]

完整的“错误”消息是:

Compiler: Default compiler Executing gcc.exe... gcc.exe "C:\Users\lavpreet\Desktop\canzone.c" -o "C:\Users\lavpreet\Desktop\canzone.exe" -g3 -I"C:\Dev-Cpp\include" -L"C:\Dev-Cpp\lib" -g3 C:\Users\lavpreet\Desktop\canzone.c:35: internal compiler error: in get_parm_info, at c-decl.c:4637 
Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://www.mingw.org/bugs.shtml> for instructions. Execution terminated

最佳答案

这一行:

void ordinamento(      struct t_album album, void confronto(struct t_album, int, int);

缺少尾随)

还有这一行:

void ordinamento(struct t_album album,void confronto(struct t_album,int,int){

缺少尾随)

关于c - 编译 C 程序时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39688112/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com