This commit is contained in:
Luca Conte 2023-10-10 11:53:11 +02:00
parent 9bbdf290da
commit 46c99c4309
3 changed files with 22 additions and 0 deletions

16
v4.2/main.c Normal file
View File

@ -0,0 +1,16 @@
#include <stdio.h>
#include "qinit.h"
#define NUM_SQUARES 100
int main(void) {
int squares[NUM_SQUARES];
qinit(&squares[0], NUM_SQUARES);
for (int i = 0; i < NUM_SQUARES; i++) {
printf("%d\n", squares[i]);
}
return 0;
}

5
v4.2/qinit.c Normal file
View File

@ -0,0 +1,5 @@
void qinit(int arr[], int len) {
for (int i = 0; i < len; i++) {
arr[i] = (i + 1) * (i + 1);
}
}

1
v4.2/qinit.h Normal file
View File

@ -0,0 +1 @@
extern void qinit(int arr[], int len);