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. read bytes in a buffer

read bytes in a buffer

Scheduled Pinned Locked Moved C / C++ / MFC
c++question
5 Posts 5 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.
  • K Offline
    K Offline
    kani98
    wrote on last edited by
    #1

    Is there a C/C++ function that will tell how many bytes are valid in a buffer?

    C D L 3 Replies Last reply
    0
    • K kani98

      Is there a C/C++ function that will tell how many bytes are valid in a buffer?

      C Offline
      C Offline
      Chris Losinger
      wrote on last edited by
      #2

      not in general. if it was allocated with GlobalAlloc/HeapAlloc, you can get the size with GlobalSize/HeapSize.

      image processing toolkits | batch image processing | blogging

      1 Reply Last reply
      0
      • K kani98

        Is there a C/C++ function that will tell how many bytes are valid in a buffer?

        D Offline
        D Offline
        David Crow
        wrote on last edited by
        #3

        kani98 wrote:

        Is there a C/C++ function that will tell how many bytes are valid in a buffer?

        Of course not. That can only be determined by the code that placed those bytes in the buffer to begin with.


        "A good athlete is the result of a good and worthy opponent." - David Crow

        "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

        1 Reply Last reply
        0
        • K kani98

          Is there a C/C++ function that will tell how many bytes are valid in a buffer?

          L Offline
          L Offline
          led mike
          wrote on last edited by
          #4

          Yes What's a "buffer"?

          led mike

          R 1 Reply Last reply
          0
          • L led mike

            Yes What's a "buffer"?

            led mike

            R Offline
            R Offline
            Rick York
            wrote on last edited by
            #5

            and what is valid ?

            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