Dynamic struct allocation LPC1343

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Dynamic struct allocation LPC1343

591 Views
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 Kudos
Reply
1 Reply

584 Views
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 Kudos
Reply