The Moulinette gives you 0 points if your code has a syntax error. Before you submit, always run gcc -Wall -Wextra -Werror yourfile.c . No warnings allowed.
int *dup_array(const int *arr, size_t n) int *r = malloc(n * sizeof *r); if (!r) return NULL; memcpy(r, arr, n * sizeof *r); return r;
Exam 01 directly mirrors the C-series projects:
if (x > 10) printf("%d is greater than 10\n", x); else printf("%d is less than or equal to 10\n", x);
The Moulinette gives you 0 points if your code has a syntax error. Before you submit, always run gcc -Wall -Wextra -Werror yourfile.c . No warnings allowed.
int *dup_array(const int *arr, size_t n) int *r = malloc(n * sizeof *r); if (!r) return NULL; memcpy(r, arr, n * sizeof *r); return r; c piscine exam 01
Exam 01 directly mirrors the C-series projects: The Moulinette gives you 0 points if your
if (x > 10) printf("%d is greater than 10\n", x); else printf("%d is less than or equal to 10\n", x); if (!r) return NULL