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
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 207
Joined: Mon Apr 24, 2017 4:23 am

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

Post by tomay3000 »

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: 19158
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 »

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
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 207
Joined: Mon Apr 24, 2017 4:23 am

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

Post by tomay3000 »

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

Thank you for the hint anyway.
Post Reply