How to convert an int to a base 2 (binary) wxString? Topic is solved

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
tomay3000
Earned some good credits
Earned some good credits
Posts: 141
Joined: Mon Apr 24, 2017 4:23 am

How to convert an int to a base 2 (binary) wxString?

Post by tomay3000 » Thu Aug 01, 2019 3:15 pm

Hello,
I could not find any wx function that converts an int to a base 2 (binary) wxString.

TIA.

User avatar
doublemax
Moderator
Moderator
Posts: 13879
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: How to convert an int to a base 2 (binary) wxString?

Post by doublemax » Thu Aug 01, 2019 3:36 pm

http://www.cplusplus.com/reference/cstdlib/itoa/

If it's not available on your system, writing your own function is very trivial.
Use the source, Luke!

tomay3000
Earned some good credits
Earned some good credits
Posts: 141
Joined: Mon Apr 24, 2017 4:23 am

Re: How to convert an int to a base 2 (binary) wxString?

Post by tomay3000 » Thu Aug 01, 2019 10:56 pm

I found out that I can do it via std::bitset

Thank you for the hint anyway.

Post Reply