EngineersGarage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise
You are here: Home / Replies / Hi Ray,Yes, as soon as you

Hi Ray,Yes, as soon as you

|

Microcontroller › AVR › Structures and Memory › Hi Ray,Yes, as soon as you

December 10, 2013 at 5:19 am #10714
AJISH ALFRED
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;
}

 

RSS Recent Posts

  • Phone to op amp circuit? March 14, 2026
  • ESP32 battery-powered IoT project March 14, 2026
  • Want Thermal Camera with Fixed Thermal Span option March 14, 2026
  • Very Curious Issue With DS3231 RTC Clock March 14, 2026
  • Fender rumble 100 base amp, power, light and overdrive light flash repeatedly when power turned on no output March 14, 2026

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2026 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise