Skip to content
IT Nursery
  • Home
  • Programming
    • Mac / IOS
    • Android
    • Web Applications
    • PHP
    • Java
    • C
    • C++
  • DataBase
    • MySQL
  • CMS
    • WordPress
  • System and Network
    • Serverfault

free

Setting variable to NULL after free

by IT Nursery

In my company there is a coding rule that says, after freeing any memory, reset the variable to NULL. For example … void … Read more

Tags c, coding-style, free, heap-memory, malloc

How do malloc() and free() work?

by IT Nursery

I want to know how malloc and free work. int main() { unsigned char *p = (unsigned char*)malloc(4*sizeof(unsigned char)); memset(p,0,4); strcpy((char*)p,”abcdabcd”); // **deliberately … Read more

Tags c, free, malloc, memory-management

How does free know how much to free?

by IT Nursery

In C programming, you can pass any kind of pointer you like as an argument to free, how does it know the size … Read more

Tags c, free, pointers, size

What REALLY happens when you don’t free after malloc before program termination?

by IT Nursery

We are all taught that you MUST free every pointer that is allocated. I’m a bit curious, though, about the real cost of … Read more

Tags c, free, malloc

Recent Posts

  • Advice for improving internal dashboard [closed]
  • grep : ‘+’ special character
  • File location for Syslogs in Centos machine
  • How to collect users’ task completion times?
  • “service {FOO} start” vs. “/etc/init.d/{FOO} start”? [closed]
IT Nursery
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Important Link

  • About
  • Privacy Policy
  • Contact

IT Nursery

The Goal of ITNursery Engaging the world to foster innovation through aggregate information. Our Question Answer post, blog information, products and tools help developers and technologists in life and at work.

copyright © 2023 All Right Reserved | IT NurSery