Add pointeurs
This commit is contained in:
parent
54d038ef7d
commit
1822496295
2 changed files with 19 additions and 0 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -35,3 +35,4 @@ creation-mot-de-passe
|
|||
strcmp
|
||||
strlen
|
||||
adresses-variables
|
||||
pointeurs
|
||||
|
|
18
programmation-c-cpp/tp4/pointeurs.c
Normal file
18
programmation-c-cpp/tp4/pointeurs.c
Normal file
|
@ -0,0 +1,18 @@
|
|||
/* Les pointeurs */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main() {
|
||||
int entier;
|
||||
int *pointeur;
|
||||
|
||||
printf("Donnez un nombre entier : ");
|
||||
scanf("%d", &entier);
|
||||
|
||||
pointeur = &entier;
|
||||
|
||||
printf("La valeur %d est stockée à l'adresse %p\n", *pointeur, pointeur);
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Reference in a new issue