Common sorted list: Difference between revisions
m
Minor edit to C code
(Added C solution) |
m (Minor edit to C code) |
||
Line 181:
void* xmalloc(size_t n) {
void* ptr = malloc(n);
if (ptr == NULL)
fatal("Out of memory");
Line 224 ⟶ 217:
}
void print(const int* array, size_t len) {
printf("[");
for (size_t i = 0; i < len; ++i) {
|