This commit is contained in:
2026-01-29 18:42:21 +01:00
parent c7b1bc12a7
commit 2ae8d93f16
3 changed files with 78 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
#include <stdlib.h>
//#include <stdio.h>
int *count(int n){
if (n < 1) return NULL;
int *p = malloc(n);
if(p == NULL) return NULL;
while (n != 0){
*(p + n-1) = n;
n --;
}
return p;
}
/*
int main(){
int *rslt = count(5);
int index = 0;
while(*(rslt + index)){
printf("%i", *(rslt + index));
index ++;
}
free(rslt);
}*/