Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. memory allocation in C

memory allocation in C

Scheduled Pinned Locked Moved C / C++ / MFC
c++performancequestion
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    ravingcoder
    wrote on last edited by
    #1

    how do you allocate memory in C? (not C++) "new" is not supported in C.

    H J M 3 Replies Last reply
    0
    • R ravingcoder

      how do you allocate memory in C? (not C++) "new" is not supported in C.

      H Offline
      H Offline
      hph
      wrote on last edited by
      #2

      Hi, try malloc(), realloc() and free() Greetings, hph

      1 Reply Last reply
      0
      • R ravingcoder

        how do you allocate memory in C? (not C++) "new" is not supported in C.

        J Offline
        J Offline
        jason99
        wrote on last edited by
        #3

        In ansi C you allocate memory with malloc(); and after usage you free the allocated memory with free();

        1 Reply Last reply
        0
        • R ravingcoder

          how do you allocate memory in C? (not C++) "new" is not supported in C.

          M Offline
          M Offline
          Maximilien
          wrote on last edited by
          #4

          erm ... look at malloc and free ( and associated function, calloc, realloc, ... )


          Maximilien Lincourt "Never underestimate the bandwidth of a station wagon filled with backup tapes." ("Computer Networks" by Andrew S Tannenbaum )

          R 1 Reply Last reply
          0
          • M Maximilien

            erm ... look at malloc and free ( and associated function, calloc, realloc, ... )


            Maximilien Lincourt "Never underestimate the bandwidth of a station wagon filled with backup tapes." ("Computer Networks" by Andrew S Tannenbaum )

            R Offline
            R Offline
            ravingcoder
            wrote on last edited by
            #5

            loud and clear. doing it as we speak.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups