Managed C++ : Int to String representation of Binary

Discussion in 'C++' started by Smithy566, Sep 3, 2010.

  1. Smithy566

    Smithy566 New Member

    Joined:
    Sep 3, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Hi all,

    I'm trying to create a method in managed c++ which will convert an int to a string representation of binary.

    I have done this in C# before, but I can't work out how to do it in Managed C++

    Below is the code from my C# effort that worked.

    Scott

    // This is C# Code

    public string intToBinary(int convertThis)
    {
    string converted = Convert.ToString(convertThis, 2);
    return converted;

    }
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice