You need to decide what exactly you are trying to do first.
If you want to have a structure with a pointer to an [independent] array inside, you must declare it as
struct my_struct { int n; char *s; };
In this case, you can create the actual structure object in any way (for example, as an automatic variable)
struct my_struct ms;
and then allocate memory for the array independently
ms.s = malloc(50 * sizeof *ms.s);
There is really no general need to dynamically allocate array memory
struct my_struct ms; char s[50]; ms.s = s;
It all depends on what time of life you need from these objects. If your structure is automatic, then in most cases the array will also be automatic. If the struct object owns the memory of the array, there is simply no point in doing it otherwise. If the structure itself is dynamic, then the array must also be dynamic.
Please note that in this case you have two independent memory blocks: structure and array.
A completely different approach is to use the "struct hack" idiom. In this case, the array becomes an integral part of the structure. Both are in the same memory block. In C99, the structure will be declared as
struct my_struct { int n; char s[]; };
and create an object that you will need to dynamically highlight it all
struct my_struct *ms = malloc(sizeof *ms + 50 * sizeof *ms->s);
The size of the memory block in this case is calculated to accommodate the elements of the structure and the final array of execution time.
Note that in this case, you cannot create structure objects such as static or automatic objects. Structures with flexible array elements at the end can only be dynamically allocated in C.
Your assumption that pointer arithmetic is faster than arrays is completely wrong. Arrays work by arithmetic pointer by definition, so they are basically the same. Moreover, a genuine array (not decaying into a pointer) is usually a little faster than a pointer object. The pointer value must be read from memory, and the location of the array in memory is โknownโ (or โcalculatedโ) from the array itself.