Bonjour j'essaye de faire un petit programme avec des pointeurs mais j'ai des messages d'erreurs :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <stdio.h>
 
int main()
{
int nb1=25;
int nb2=184;
int *pt1=nb1;
int *pt2=nb2;
double nb3=3.567;
double *pt3=nb3;
 
printf("nb1=%d &nb1=%p pt1=%p pt1+1=%p *pt1=%d *pt1+1=%d *(pt1-1)=%d",nb1,&nb1,pt1,pt1+1,*pt1,*pt1+1,*(pt1-1));
return 0;
}
pointeurs.c: In function ‘main’:
pointeurs.c:7:10: warning: initialization makes pointer from integer without a cast [enabled by default]
pointeurs.c:8:10: warning: initialization makes pointer from integer without a cast [enabled by default]
pointeurs.c:10:13: error: incompatible types when initializing type ‘double *’ using type ‘double’

Pouvez-vous m'aider ? Merci