Microcontroller › AVR › Structures and Memory › Hi Ray,Yes, as soon as you
December 10, 2013 at 5:19 am
#10714
Participant
Hi Ray,
Yes, as soon as you declare the variable data, that much memory will get allocated.
You can create a pointer by creating a pointer type ‘data’ like;
struct RealTimeData
{
.....
.....
}*data;
Use dynamic memory allocation with the help of malloc()
data = (struct RealTimeData*) malloc (sizeof (struct RealTimeData)); //you may need to //modify this line
//to get compiled
You can use it in code like
When I use this code…
void SpillTime(void)
{
data -> spillControlTime = 2100;
}