memory address gets cut off after 8 digits












-4















memory address gets cuts off after 8 digits help



DWORD* memoryAddress = (DWORD*)0x155221000;


turns from 0x155221000 into 0x55221000 after conversion.










share|improve this question

























  • How do you know what's stored in your pointer value?

    – Andrew Henle
    Nov 23 '18 at 20:10








  • 2





    DWORD is 4 bytes so it should be able to store... a maximum of 0xFFFFFFFF. Exactly what you're seeing.

    – wizzwizz4
    Nov 23 '18 at 20:12











  • you are supposed to store memory addresses as pointers and i forgot it was in hex and so it was a 64 bit hex memadress i was trying to access using so small things like DWORD when i needed to use DWORD64* for the 64 bit programs memory addresses thanks all answers.

    – 4234234234324
    Nov 23 '18 at 20:23











  • Is this on Windows? If so, the datatype you are looking for is DWORD_PTR, or maybe uintptr_t.

    – Paul Sanders
    Nov 23 '18 at 20:47
















-4















memory address gets cuts off after 8 digits help



DWORD* memoryAddress = (DWORD*)0x155221000;


turns from 0x155221000 into 0x55221000 after conversion.










share|improve this question

























  • How do you know what's stored in your pointer value?

    – Andrew Henle
    Nov 23 '18 at 20:10








  • 2





    DWORD is 4 bytes so it should be able to store... a maximum of 0xFFFFFFFF. Exactly what you're seeing.

    – wizzwizz4
    Nov 23 '18 at 20:12











  • you are supposed to store memory addresses as pointers and i forgot it was in hex and so it was a 64 bit hex memadress i was trying to access using so small things like DWORD when i needed to use DWORD64* for the 64 bit programs memory addresses thanks all answers.

    – 4234234234324
    Nov 23 '18 at 20:23











  • Is this on Windows? If so, the datatype you are looking for is DWORD_PTR, or maybe uintptr_t.

    – Paul Sanders
    Nov 23 '18 at 20:47














-4












-4








-4








memory address gets cuts off after 8 digits help



DWORD* memoryAddress = (DWORD*)0x155221000;


turns from 0x155221000 into 0x55221000 after conversion.










share|improve this question
















memory address gets cuts off after 8 digits help



DWORD* memoryAddress = (DWORD*)0x155221000;


turns from 0x155221000 into 0x55221000 after conversion.







c++






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 23 '18 at 20:26







4234234234324

















asked Nov 23 '18 at 20:08









42342342343244234234234324

63




63













  • How do you know what's stored in your pointer value?

    – Andrew Henle
    Nov 23 '18 at 20:10








  • 2





    DWORD is 4 bytes so it should be able to store... a maximum of 0xFFFFFFFF. Exactly what you're seeing.

    – wizzwizz4
    Nov 23 '18 at 20:12











  • you are supposed to store memory addresses as pointers and i forgot it was in hex and so it was a 64 bit hex memadress i was trying to access using so small things like DWORD when i needed to use DWORD64* for the 64 bit programs memory addresses thanks all answers.

    – 4234234234324
    Nov 23 '18 at 20:23











  • Is this on Windows? If so, the datatype you are looking for is DWORD_PTR, or maybe uintptr_t.

    – Paul Sanders
    Nov 23 '18 at 20:47



















  • How do you know what's stored in your pointer value?

    – Andrew Henle
    Nov 23 '18 at 20:10








  • 2





    DWORD is 4 bytes so it should be able to store... a maximum of 0xFFFFFFFF. Exactly what you're seeing.

    – wizzwizz4
    Nov 23 '18 at 20:12











  • you are supposed to store memory addresses as pointers and i forgot it was in hex and so it was a 64 bit hex memadress i was trying to access using so small things like DWORD when i needed to use DWORD64* for the 64 bit programs memory addresses thanks all answers.

    – 4234234234324
    Nov 23 '18 at 20:23











  • Is this on Windows? If so, the datatype you are looking for is DWORD_PTR, or maybe uintptr_t.

    – Paul Sanders
    Nov 23 '18 at 20:47

















How do you know what's stored in your pointer value?

– Andrew Henle
Nov 23 '18 at 20:10







How do you know what's stored in your pointer value?

– Andrew Henle
Nov 23 '18 at 20:10






2




2





DWORD is 4 bytes so it should be able to store... a maximum of 0xFFFFFFFF. Exactly what you're seeing.

– wizzwizz4
Nov 23 '18 at 20:12





DWORD is 4 bytes so it should be able to store... a maximum of 0xFFFFFFFF. Exactly what you're seeing.

– wizzwizz4
Nov 23 '18 at 20:12













you are supposed to store memory addresses as pointers and i forgot it was in hex and so it was a 64 bit hex memadress i was trying to access using so small things like DWORD when i needed to use DWORD64* for the 64 bit programs memory addresses thanks all answers.

– 4234234234324
Nov 23 '18 at 20:23





you are supposed to store memory addresses as pointers and i forgot it was in hex and so it was a 64 bit hex memadress i was trying to access using so small things like DWORD when i needed to use DWORD64* for the 64 bit programs memory addresses thanks all answers.

– 4234234234324
Nov 23 '18 at 20:23













Is this on Windows? If so, the datatype you are looking for is DWORD_PTR, or maybe uintptr_t.

– Paul Sanders
Nov 23 '18 at 20:47





Is this on Windows? If so, the datatype you are looking for is DWORD_PTR, or maybe uintptr_t.

– Paul Sanders
Nov 23 '18 at 20:47












1 Answer
1






active

oldest

votes


















1














On a 32bits system, an address is 4 bytes long. So DWORD* memoryAddress = (DWORD*)0x155221000; would be truncated by definition (also bad to use C-style casts). The compiler should give you a truncation warning by the way.



1428295680 is the base-10 representation of the same value (addresses are usually represented in hexadecimal, still the same value).



As the comments from different people said, DWORD is 4 bytes (just a coincidence that addresses are also 4 bytes), it would also truncate your number for the same reason.






share|improve this answer

























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53452426%2fmemory-address-gets-cut-off-after-8-digits%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    On a 32bits system, an address is 4 bytes long. So DWORD* memoryAddress = (DWORD*)0x155221000; would be truncated by definition (also bad to use C-style casts). The compiler should give you a truncation warning by the way.



    1428295680 is the base-10 representation of the same value (addresses are usually represented in hexadecimal, still the same value).



    As the comments from different people said, DWORD is 4 bytes (just a coincidence that addresses are also 4 bytes), it would also truncate your number for the same reason.






    share|improve this answer






























      1














      On a 32bits system, an address is 4 bytes long. So DWORD* memoryAddress = (DWORD*)0x155221000; would be truncated by definition (also bad to use C-style casts). The compiler should give you a truncation warning by the way.



      1428295680 is the base-10 representation of the same value (addresses are usually represented in hexadecimal, still the same value).



      As the comments from different people said, DWORD is 4 bytes (just a coincidence that addresses are also 4 bytes), it would also truncate your number for the same reason.






      share|improve this answer




























        1












        1








        1







        On a 32bits system, an address is 4 bytes long. So DWORD* memoryAddress = (DWORD*)0x155221000; would be truncated by definition (also bad to use C-style casts). The compiler should give you a truncation warning by the way.



        1428295680 is the base-10 representation of the same value (addresses are usually represented in hexadecimal, still the same value).



        As the comments from different people said, DWORD is 4 bytes (just a coincidence that addresses are also 4 bytes), it would also truncate your number for the same reason.






        share|improve this answer















        On a 32bits system, an address is 4 bytes long. So DWORD* memoryAddress = (DWORD*)0x155221000; would be truncated by definition (also bad to use C-style casts). The compiler should give you a truncation warning by the way.



        1428295680 is the base-10 representation of the same value (addresses are usually represented in hexadecimal, still the same value).



        As the comments from different people said, DWORD is 4 bytes (just a coincidence that addresses are also 4 bytes), it would also truncate your number for the same reason.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Nov 23 '18 at 23:09

























        answered Nov 23 '18 at 20:11









        Matthieu BrucherMatthieu Brucher

        15.6k32140




        15.6k32140
































            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53452426%2fmemory-address-gets-cut-off-after-8-digits%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            404 Error Contact Form 7 ajax form submitting

            How to know if a Active Directory user can login interactively

            TypeError: fit_transform() missing 1 required positional argument: 'X'