My program hangs while running a piece of code that uses this array. Unfortunately, I cannot describe everything here, because very big piece of code.
I have a structure:
struct element { char *one; char *two; };
Next comes an array of such structures (statically declared):
struct element array[] = { {"1 field", "2 field"}, {"3 field", "4 field"}, {"5 field", "6 field"} };
On the one hand, the array is declared statically - why allocate memory. On the other hand, the structure fields are pointers (memory is allocated for pointers, not strings).
Is there a mistake here?
a == b
filled) and the error in the question has no relation to it. - avp