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. Hello can somebody explain me how many 0x90 can i add into BYTE / WORD / DWORD

Hello can somebody explain me how many 0x90 can i add into BYTE / WORD / DWORD

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

    Im on c++ and if i define a BYTE, WORD, DWORD or is there something larger that can hold more bites? const BYTE NopTwoBytes[2] = {0x90, 0x90}; Now how much could hold word and dword and is there something more larger?

    M T 2 Replies Last reply
    0
    • N nah1337

      Im on c++ and if i define a BYTE, WORD, DWORD or is there something larger that can hold more bites? const BYTE NopTwoBytes[2] = {0x90, 0x90}; Now how much could hold word and dword and is there something more larger?

      M Offline
      M Offline
      Mark Salsbery
      wrote on last edited by
      #2

      Your question doesn't make much sense :) The sizes of the Windows data types you mention are: BYTE 1 byte WORD 2 bytes DWORD 4 bytes DWORD64 8 bytes The value 0x90 fits in one byte.

      Mark Salsbery Microsoft MVP - Visual C++ :java:

      N 1 Reply Last reply
      0
      • M Mark Salsbery

        Your question doesn't make much sense :) The sizes of the Windows data types you mention are: BYTE 1 byte WORD 2 bytes DWORD 4 bytes DWORD64 8 bytes The value 0x90 fits in one byte.

        Mark Salsbery Microsoft MVP - Visual C++ :java:

        N Offline
        N Offline
        nah1337
        wrote on last edited by
        #3

        thnx for ur good answer it really clears things up

        1 Reply Last reply
        0
        • N nah1337

          Im on c++ and if i define a BYTE, WORD, DWORD or is there something larger that can hold more bites? const BYTE NopTwoBytes[2] = {0x90, 0x90}; Now how much could hold word and dword and is there something more larger?

          T Offline
          T Offline
          tmcgarr
          wrote on last edited by
          #4

          Probably the most complex but easy to use C++ construct is "sizeof". This little wonder will tell you the size of almost anything except Bill Gate's wallet. For example: printf("The size of a BYTE = %d\n", sizeof(BYTE)); struct MyStruct{ int x; float y; char wibble[256]; ... }; size_t MystructSize = sizeof(MyStruct); Well you get the idea. Quite an amazing little fellow is "sizeof" Regards T

          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