Home > Back-end >  Value of type int * can not be assigned to the entity of type int
Value of type int * can not be assigned to the entity of type int

Time:12-12

Defines a structure body
 
Typedef struct binElement
{
Float weight;
Int voxelIndex;
} binElement;

To define a structure, in which the element contains the first structure element
 
Typedef struct LORData
{
PElement binElement *;
Int LORIndex;
Int voxelNum;
} LORData;

In the main () function in the
 
LORData * List;
Int a, b, c1, c2,... , d1, d2,... ;//this a few assumptions have assignment;
for(int i=0; i{
The List - & gt; LORIndex=a;
The List - & gt; VoxelNum=b;
for(int j=0; j{
The List - & gt; PElement [j]. Weight=c1;//here, according to the error will not float * type distribution of the value of the collocation of float type of entity
The List - & gt; PElement [j] voxelIndex=d1;//an error here, according to a value of type int * can not be assigned with the int type of entity
}
}

CodePudding user response:

What you posted there is no problem, in addition to int voxelNum behind the semicolon is Chinese semicolons,

CodePudding user response:

reference 1st floor srhouyu response:
what you posted there is no problem, in addition to int voxelNum behind the semicolon is Chinese semicolons,

Hello, the main () function, there are two place error,

How can I change this part, many thanks!

CodePudding user response:

refer to the second floor anew_moon response:
Quote: refer to 1st floor srhouyu response:

What you posted there is no problem, in addition to int voxelNum behind the semicolon is Chinese semicolons,

Hello, the main () function, there are two place error,

How can I change this part, many thanks!


See here don't see any light, he said your voxelID and weight is type int * and that may be, you check again,

CodePudding user response:

You this two Pointers LORData * list and binElement * pElement didn't allocate space ah,,,,

CodePudding user response:

The List - & gt; PElement [j]. Weight=c1;
The small white is to want to ask, pElement [j] you define pElement pointer array is not defined only can use?
The List - & gt; * pElement. Weight=c1; This is good
  • Related