| un entier |
int* pin; pin = (int*) malloc(sizeof(int)); |
| un réel |
int* pr; pr = (float*) malloc(sizeof(float)); |
| un caractère |
char* pc; pc = (char*) malloc(sizeof(char)); |
| une chaîne de 20
caractères |
char* ps; ps = (char*) malloc(20*sizeof(char)); |
| Une variable
structurée point |
typedef struct { int px; int py; } point; point* po; po = (point*) malloc(sizeof(point)); |
| Un tableau de 40 points |
point* tabPo; tabPo = (point*) malloc(40*sizeof(point)); |