Affichage d'un pointeur
Youssef.Idelhadj
Messages postés
19
Statut
Membre
-
Youssef.Idelhadj Messages postés 19 Statut Membre -
Youssef.Idelhadj Messages postés 19 Statut Membre -
Bonjour,
J'ai du mal à afficher un pointeur en int, mon programme est :
#include<stdio.h>
#include<stdlib.h>
int main(void)
{
int age=10;
printf(" Age : %d",age);
printf(" Age : %d",&age);
return 0;
}
et qu'on je compile sur gcc, il me sort comme erreur :
test.c: In function `main':
test.c:8:3: attention : format `%d' expects argument of type `int', but argument 2 has type `int *' [-Wformat]
En fait, ça marche qu'on je mets %p, vu que c'est un affichage en héxadécimal, mais moi je veux un affichage en entier.
Merci d'avance
J'ai du mal à afficher un pointeur en int, mon programme est :
#include<stdio.h>
#include<stdlib.h>
int main(void)
{
int age=10;
printf(" Age : %d",age);
printf(" Age : %d",&age);
return 0;
}
et qu'on je compile sur gcc, il me sort comme erreur :
test.c: In function `main':
test.c:8:3: attention : format `%d' expects argument of type `int', but argument 2 has type `int *' [-Wformat]
En fait, ça marche qu'on je mets %p, vu que c'est un affichage en héxadécimal, mais moi je veux un affichage en entier.
Merci d'avance
A voir également:
- Affichage d'un pointeur
- Pointeur souris - Guide
- Curseur Windows 10 : comment bien voir la souris à l'écran - Guide
- Affichage double ecran - Guide
- Windows 11 affichage classique - Guide
- Problème affichage fenêtre windows 10 - Guide