#include
#include
int *setarray(int *ar,char *str)
{
int offset,n,i=0;
while (sscanf(str, " %d%n", &n, &offset)==1)
{
ar[i]=n;
str+=offset;
i+=1;
}
return ar;
}
int main()
{
int *sz=malloc(5*sizeof(int)),i;
//call
setarray(sz,"10 30");
//output
for(i=0;i<2;i++)
printf("%d\n",sz[i]);
return 0;
}