[English]
Hello guys'n girls...
either I am dumb or I'm simply blind.
I'll simply explain the problem with some pseudo code.
The problematic line of code is marked as that in the sample code.
The compiler tells me "subscript needs array or pointer type" though, if my eyes don't lie to me, I declared aVariable as a pointer.
Is this unsupported in Lite-C free or a bug?
Maybe I'm just missing something?
I'm asking for your advice.
[German]
Hallo Jungs und Mädels...
entweder bin ich blöd oder blind.
Ich werde das Problem einfach mit etwas Pseudocode erklären.
Die problematische Programmzeile ist im Code markiert.
Der Compiler sagt mir nur "subscript needs array or pointer type", obwohl ich, wenn mich meine Augen nicht rügen, aVariable als Pointer deklariert habe.
Wird sowas von Lite-C free nicht unterstützt oder ist das ein Bug?
Vielleicht hab ich auch nur was übersehen?
Ich bitte um euern Rat.
typedef struct MYSTRUCT1
{
somestuff;
somestuff;
somestuff;
} MYSTRUCT1;
typedef struct MYSTRUCT2
{
MYSTRUCT1* aVariable;
somestuff;
} MYSTRUCT2;
MYSTRUCT2 hereItGoes;
function MyCoolFunction()
{
hereItGoes.aVariable = (MYSTRUCT1*)malloc(sizeof(MYSTRUCT)*iNeedItSeveralTimes);
int index;
for(index = 0; index <= iNeedItSeveralTimes; index++)
hereItGoes.aVariable[index] = aValue; //<-- problematic line of code is here
}