Jump to content

warning: assignment makes integer from pointer without a cast


alexmgarcia
 Share

Recommended Posts

Boas,

Estou a fazer um projecto para a universidade que é a gestão de requisições de uma biblioteca que utiliza um ficheiro txt como base de dados (por mim era SQL, mas os docentes pediram assim).

No entanto, ao compilar o código que já fiz obtenho uns warnings e estou aqui a colocar esta dúvida de modo a perceber o que leva estes warnings surgirem.

main.c: In function `elimina_proposta':

main.c:27: warning: assignment makes integer from pointer without a cast

main.c:44: warning: assignment makes integer from pointer without a cast

main.c: In function `verifica_existe':

main.c:186: warning: passing arg 2 of `strcmp' makes pointer from integer without a cast

main.c: In function `adicionar':

main.c:227: warning: passing arg 1 of `verifica_existe' makes integer from pointer without a cast

Tenho uma estrutura que é a seguinte:

typedef struct {
    int qtsautores;
    char autor[4][40];
    char titulo[25];
    char coleccao[15];
    char isbn[20];
} livros;
livros livro[MAX_LIV];

Aqui segue-se o código de cada uma das linhas acima indicadas

linha 27

livro[id].qtsautores = NULL;

linha 44

livro[id+1].qtsautores = NULL;

linha 186

if (strcmp(livro[i].isbn,isbn) == 0) {

linha 227

if (verifica_existe(livro[j].isbn)) {

Alguma sugestão do que possa fazer para evitar os warnings?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.