Dynamic struct allocation LPC1343

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Dynamic struct allocation LPC1343

589件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by killua on Wed May 09 13:55:30 MST 2012
Hello.

As is says in the title, how can I dynamically allocate a structure, but not all at the same time..

Let's say I have

struct car{
int noWheels;
char name[10];
}a[];

int noStruct=0;


now whenever I get new data over the usb I want to create another structure in an array a[] (thats what the noStruct variable is for, it will keep an eye on how many structures I already have)?


Thanks
0 件の賞賛
返信
1 返信

582件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by atomicdog on Wed May 09 21:37:06 MST 2012
Research linked lists and malloc for ideas.
0 件の賞賛
返信