Problème "makes pointer from integer without a cast"
Bonsoir,
Je ne comprends pas pourquoi quand j’exécute mon code, il ne fonctionne pas et je reçois l'erreur suivante :
Code:
1 2 3 4 5 6
| point.c: In function ‘main’:
point.c:13:28: warning: passing argument 1 of ‘demanderLigneEtColonne’ makes pointer from integer without a cast [-Wint-conversion]
demanderLigneEtColonne(*ligne, *colonne);
^~~~~~
point.c:6:34: note: expected ‘int *’ but argument is of type ‘int’
void demanderLigneEtColonne(int* ligne, int* colonne); |
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
| #include<stdio.h>
#include<stdlib.h>
#define TAILLE_GRILLE 20
void demanderLigneEtColonne(int* ligne, int* colonne);
int main(){
int* ligne;
int* colonne;
demanderLigneEtColonne(*ligne, *colonne);
return 0;
}
void demanderLigneEtColonne(int* ligne, int* colonne){
printf("\n");
printf("Entrez la prochaine ligne a jouer ? ");
scanf("%d", &ligne);
printf("\n");
if(ligne <= 0 & ligne > TAILLE_GRILLE){
printf("Ce nombre n'est pas entre 1 et 20\n");
}
printf("Entrez la prochaine colonne a jouer ? ");
scanf("%d", &colonne);
printf("\n");
if(colonne <= 0 & colonne > TAILLE_GRILLE){
printf("Ce nombre n'est pas entre 1 et 20\n");
}
} |