I am taking in input from the user for the number of elemenets inside an array. The array is inside my struct 'Polymer'
struct Polymer
{
int length;
struct Monomer *monomer;
}polymer;
In main, I am creating a new monomer array pointer and setting the mononomer pointer in "Polymer" to it
struct Monomer *monomers[size];
polymer.monomer = momomers;
I am getting the error "Assignment from incompatible pointer type" which I assume is because we are converting a monomer array pointer to a monomer. How do I declare it as a monomer array pointer in the struct?
size_tfor array sizes, string lengths, and anything else with a size.intis signed (you don't want an array of -1 length, do you?) and is not guaranteed to be large enough to properly store a size (or, in the pathological case, it might be too large).