Assuming you want to allocate a structure with a flexible array member, and not assign a pointer to an array (which as others have stated - you can't do that)
To use a flexible array member, you need to allocate the structure plus an amount of memory for the array.
typedef struct s
{
int x[];
}s;
int main()
{
s *some = malloc( sizeof( *some ) + ( 10 * sizeof( int ) ) );
for ( int i = 0; i < 10; i++ )
some->x[i] = i + 10;
return 0;
}
Note that you can not leave the sizeof( struct ... ) out of the allocation - the structure's presence is not guaranteed to be zero, even when the flexible array member is the only field in the structure.
As @chux noted in the comments, this would be more consistent with using variables instead of types as sizeof() arguments:
s *some = malloc( sizeof( *some ) + ( 10 * sizeof( some->x[0] ) ) );