This repository has been archived on 2026-05-11. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
2026-02-02 04:52:09 +01:00

31 lines
440 B
C

#include <stdlib.h>
#include <stdio.h>
int *count(int n){
if (n < 1) return NULL;
int *p = malloc(n * sizeof(int));
if(p == NULL) return NULL;
while (n != 0){
*(p + n-1) = n;
n --;
}
return p;
}
/*
int main(){
int *rslt = count(5123456);
int index = 0;
while(*(rslt + index)){
printf("%i, ", *(rslt + index));
index ++;
}
free(rslt);
}
*/