Dynamic struct allocation LPC1343

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Dynamic struct allocation LPC1343

653 次查看
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 回复

646 次查看
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 项奖励
回复