Looking for CC - P1 - Promo 2029 test answers and solutions? Browse our comprehensive collection of verified answers for CC - P1 - Promo 2029 at moodle.myefrei.fr.
Get instant access to accurate answers and detailed explanations for your course questions. Our community-driven platform helps students succeed!
We would like to define a function that updates the length of the side of a t_square.
Among the following prototypes, which one is correct ?
On considère la suite d'instructions suivante :
t_square ** squares = (t_square **)malloc(10 * sizeof(t_square *));
for (int i = 0; i < 10; i++) {
squares[i] = create_square(0 , i + 1, i + 1);
}
Parmi les affirmations suivantes, lesquelles sont vraies ?
La fonction print_square affiche les informations d'un carré de type t_square: les coordonnées de son coin supérieur gauche et son côté. Parmi les définitions suivantes, laquelle est correcte ?
A function t_square * create_square(int a, int b, int n) dynamically allocates memory to store a t_square. It dynamically allocates and initializes its top_left field with the call to the function create_point(a, b). It also initializes its side field with the value n.
We then consider the following instruction :
t_square * sq = create_square(1, 2, 3);
Among the following instructions, which one allows us to free all the memory allocated by create_square ?
On souhaite écrire une fonction qui met à jour la longueur du côté d'un t_square.
Parmi les prototypes suivants, lequel est correct ?
Une fonction t_square * create_square(int a, int b, int n) alloue dynamiquement de la mémoire pour stocker un t_square. Elle alloue et initialise son champ top_left avec l'appel de la fonction create_point(a, b). Et initialise également son champ side avec la valeur n.
On considère ensuite l'instruction suivante :
t_square * sq = create_square(1, 2, 3);
Parmi les suite d'instructions suivantes, laquelle permet de libérer toute la mémoire allouée par create_square ?
The following function allocates memory dynamically to store a t_point.
t_point * create_point(int a, int b) {
t_point * p = (t_point *)malloc(sizeof(t_point));
p->x = a;
p->y = b;
return p;
}
Among the following values, which ones are stored in the heap ?
On considère le type structuré t_square définit par
typedef struct s_square {
t_point * top_left;
int side;
} t_square;
Parmi les propositions suivantes, lesquelles sont correctes ?
Consider a structured type t_square defined by
typedef struct s_square {
t_point * top_left;
int side;
} t_square;
Among the following statements, which ones are correct ?
We would like to define a structured type t_point that represents a point with integer coordinates in the plane. Among the following definitions, which one does not allow us to define this type ?