Hello! The function below aims, whenever called, to allocate a memory space that will serve as a "set" for future uses. These sets must be identified by a number, starting at 0 for the first set and so on, however, that identifier needs to be used in other functions. This ID should be returned if the memory space is allocated correctly (there where return 1 is, it should be the return "identifier"). How to do something like this, starting at 0 and can be used in other functions?
int criar(){
int *p;
p = malloc(50*sizeof(int));
if(p!=NULL)
return 1;
else
return -1;
}