- #include <stdio.h>
- #include <alloc.h>
-
- void main(void)
- {
- char far *chaine;
- int far *int_valeurs;
- float far *valeurs_flottantes;
-
- if ((chaine = (char *) farmalloc(50)))
- printf("Allocation réussie d\'une chaîne de 50 octets\n");
- else
- printf("Erreur d\'allocation pour chaine\n");
- if ((int_valeurs = (int *) farmalloc(100 * sizeof(int))) != NULL)
- printf("Allocation réussie pour int_valeurs[100]\n");
- else
- printf("Erreur d\'allocation pour int_valeurs[100]\n");
- if ((valeurs_flottantes = (float *) farmalloc(25 * sizeof(float))) != NULL)
- printf("Allocation réussie pour valeurs_flottantes[25]\n");
- else
- printf("Erreur d\'allocation pour valeurs_flottantes[25]\n");
- }
-
#include <stdio.h>
#include <alloc.h>
void main(void)
{
char far *chaine;
int far *int_valeurs;
float far *valeurs_flottantes;
if ((chaine = (char *) farmalloc(50)))
printf("Allocation réussie d\'une chaîne de 50 octets\n");
else
printf("Erreur d\'allocation pour chaine\n");
if ((int_valeurs = (int *) farmalloc(100 * sizeof(int))) != NULL)
printf("Allocation réussie pour int_valeurs[100]\n");
else
printf("Erreur d\'allocation pour int_valeurs[100]\n");
if ((valeurs_flottantes = (float *) farmalloc(25 * sizeof(float))) != NULL)
printf("Allocation réussie pour valeurs_flottantes[25]\n");
else
printf("Erreur d\'allocation pour valeurs_flottantes[25]\n");
}