There are a couple of issues:
Because you used a typedef, you don't need to add 'struct' in front of your data type:
data_pack* packet = malloc(sizeof(data_pack));
And because you've declared in_array as a void ptr, you shouldn't cast it to a double:
packet->in_array= malloc(100 * sizeof(double));
(In fact, don't cast the result of malloc to anything..)
EDIT:
In response to the comment, if you wanted an array of type double you can change the declaration of data_pack to:
typedef struct{
int message;
double *in_array;
}data_pack;
Then treat it as an array:
packet->in_array[0] = 0.1;
packet->in_array[1] = 0.2;
and so on; but if you wanted an array of pointers to double then you change the declaration of in_array to:
typedef struct{
int message;
double **in_array;
}data_pack;
And, because you are now storing an array of pointers that point to doubles instead of doubles, you change your malloc of in_array to:
packet->in_array= malloc(100 * sizeof(double *));
Then, you can add pointers to doubles to that array, for example:
double foo = 0.1;
packet->in_array[0] = &foo;
EDIT 2
To copy the contents of one array to another, use memcpy:
#include <string.h>
double foo[100] = {0.1,0.2};
memcpy( packet->in_array, foo, sizeof(foo));
It works both ways:
double foo[100] = {};
memcpy( foo, packet->in_array, sizeof(foo));