allocate memory to specific array, write values to it