logo

Crowdly

Browser

Add to Chrome

CC - P1 - Promo 2029

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 ?

View this question

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 ?

14%
0%
View this question

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 ?

View this question

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 ?

0%
0%
0%
0%
View this question

On souhaite écrire une fonction qui met à jour la longueur du côté d'un t_square.

Parmi les prototypes suivants, lequel est correct ?

View this question

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 ?

0%
0%
0%
0%
View this question

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 ?

View this question

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 ?

0%
0%
0%
0%
View this question

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 ?

0%
0%
0%
0%
View this question

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 ?

0%
0%
0%
0%
View this question

Want instant access to all verified answers on moodle.myefrei.fr?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome