LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Referenced before initialized ???

hi all,

maybe a simple C-question:

I build an array of structures as a temporal local variable in a function, then put some contents into the array-structures and give the array to a function in the following manner:

//in a function...

struct TableColumn theColumns[PLOT_REGION_TABLE_COL_NUMBER_WITH_PA_LONG];

strcpy(theColumns[0].sZColName,"Name");
theColumns[0].lfColWidthRelative=0.2;
theColumns[1].lfColWidthRelative=0.35;

//................

pPlot->ctrlHandle=PLOT_buildGraphicalRepresentationTable(pPlot,PLOT_REGION_TABLE_COL_NUMBER_WITH_PA_LONG, theColumns);

The compiler says to me: "Local "theColumns" was referenced before beeing initialized". why this - any idea ?

best regards

simon
0 Kudos
Message 1 of 2
(2,958 Views)

Probably because not ALL of the structure elements were initialised at the point the compiler complained. (Difficult to say, without seeing the structure definition.)

 

JR

0 Kudos
Message 2 of 2
(2,946 Views)