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 / malloc() is a method used for

malloc() is a method used for

|

Microcontroller › AVR › Structures and Memory › malloc() is a method used for

December 12, 2013 at 4:23 am #10727
AJISH ALFRED
Participant

malloc() is a method used for dynamic memory allocation. malloc() creates a block of memory whenevr that function is called and in our case we are pointing our structure pointer to that memory block.

“Every pointer needs to be pointed to a memory before it is accessed”.

In this case the memory of the size of the structure will get allocated only after the malloc() is called. Once you’ve done, you can remove that memory using the function free().

 

Suggest you to google it for a good tutorial

 

http://www.codingunit.com/c-tutorial-the-functions-malloc-and-free

http://www.cprogramming.com/tutorial/c/lesson6.html

 

Still having doubts, please feel free to post here.

RSS Recent Posts

  • A Comparison of Output Power: Qi Charging vs NFC-WLC Charging August 11, 2026
  • free s-param assesment tool reccomendation August 10, 2026
  • dosen't work as planned August 10, 2026
  • My Advanced Realistic Humanoid Robots Project August 9, 2026
  • Replacement for Multisim Live August 9, 2026

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2026 Arrowfly 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 Arrowfly
Privacy Policy | Advertising

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