#include <stdio.h>
#include <malloc.h>
#include <stdbool.h>
struct ARRAY{
int cnt;
int *parr;
};
bool init(struct ARRAY *p,int len)
{
p->parr=(int *)malloc(sizeof(int)*len);
if(p==NULL){
printf("invalid");
return false;
}else{
return true;
}
}
void append(struct ARRAY *p,int number)
{
p->parr[p->cnt]=number;
(p->cnt)++;
return;
}
int main()
{
struct ARRAY array;
if(init(&array,10)){
append(&array,1);
append(&array,2);
append(&array,3);
}
free(array);
return 0;
}