This commit is contained in:
2026-02-02 04:52:09 +01:00
parent fca4d20f5a
commit 49213b1343
6 changed files with 64 additions and 54 deletions
+8 -6
View File
@@ -1,8 +1,10 @@
#include <stdlib.h>
//#include <stdio.h>
#include <stdio.h>
int *count(int n){
if (n < 1) return NULL;
int *p = malloc(n);
int *p = malloc(n * sizeof(int));
if(p == NULL) return NULL;
while (n != 0){
@@ -14,15 +16,15 @@ int *count(int n){
}
/*
int main(){
int *rslt = count(5);
int *rslt = count(5123456);
int index = 0;
while(*(rslt + index)){
printf("%i", *(rslt + index));
printf("%i, ", *(rslt + index));
index ++;
}
free(rslt);
}*/
}
*/