About 216,000 results
Open links in new tab
  1. malloc - cppreference.com

    Sep 3, 2023 · Allocates size bytes of uninitialized storage. If allocation succeeds, returns a pointer that is suitably aligned for any object type with fundamental alignment. If size is zero, the behavior of malloc …

  2. Dynamic Memory Allocation in C - GeeksforGeeks

    Dec 12, 2025 · The malloc () (stands for memory allocation) function is used to allocate a single block of contiguous memory on the heap at runtime. The memory allocated by malloc () is uninitialized, …

  3. C library - malloc () function

    The C stdlib library malloc () function is used for dynamic memory allocation. It allocates or reserves a block of memory of specified number of bytes and returns a pointer to the first byte of the allocated …

  4. C stdlib malloc () Function - W3Schools

    Definition and Usage The malloc() function allocates memory and returns a pointer to it. Unlike calloc() the memory is not initialized, so the values are unpredictable. The malloc() function is defined in the …

  5. C Dynamic Memory Allocation Using malloc (), calloc (), free ...

    In this tutorial, you'll learn to dynamically allocate memory in your C program using standard library functions: malloc (), calloc (), free () and realloc () with the help of examples.

  6. malloc | Microsoft Learn

    Feb 7, 2023 · The malloc function allocates a memory block of at least size bytes. The block may be larger than size bytes because of the space that's required for alignment and maintenance information.

  7. Malloc Examples (The GNU C Library)

    In the GNU C Library, a successful malloc (0) returns a non-null pointer to a newly allocated size-zero block; other implementations may return NULL instead. POSIX and the ISO C standard allow both …

  8. Understanding Malloc: Dynamic Memory Allocation in C

    Malloc provides the foundation for most non-trivial dynamic data structures and object usage in C. Mastering common patterns unlocks cleaner code less prone to memory issues.

  9. How to Use malloc in C: A Complete Guide to Dynamic Memory …

    Learn how to use malloc in C with clear examples, from basic syntax to dynamic memory management for arrays, strings, and structures. Perfect for C beginners.

  10. malloc () Function - C stdlib.h - Syntax, Parameters, Examples

    The malloc() function in C dynamically allocates a block of memory and returns a pointer to its beginning. The allocated memory is uninitialized and may contain indeterminate values until explicitly …