| View previous topic :: View next topic |
| Author |
Message |
Tadzio Guest
|
Posted: Fri Feb 27, 2004 6:33 pm Post subject: How to use to_string() from bitset.h |
|
|
Hi all !
I have code:
bitset<10> w(string("1111110000"));
and i want to put in on Edit1->Text
Edit1->Text=w; // don't works and i don't know how to convert w to
AnsiString
Please help me.
Filip Kasperkiewicz
|
|
| Back to top |
|
 |
Thomas Matthews Guest
|
Posted: Fri Feb 27, 2004 9:33 pm Post subject: Re: How to use to_string() from bitset.h |
|
|
Tadzio wrote:
| Quote: | Hi all !
I have code:
bitset<10> w(string("1111110000"));
and i want to put in on Edit1->Text
Edit1->Text=w; // don't works and i don't know how to convert w to
AnsiString
Please help me.
Filip Kasperkiewicz
|
FYI, AnsiString is a Borland invention, that causes
me great stress. For more information, consult your
Borland documentation (i.e. the help file) or a
Borland Newsgroup.
<Off-Topic>
One nice feature of the AnsiString is that it has
a constructor that takes a C-style string (array
of char). The array of character is the vehicle
used to convert between std::string and AnsiString.
Let us have:
AnsiString borland_string;
std::string cpp_string;
From std::string to AnsiString:
borland_string = AnsiString(cpp_string.c_str());
From AnsiString to std::string:
cpp_string = borland_string.c_str();
Life would be much better if Borland had a
constructor in AnsiString to create from a std::string.
A method for producing an std::string from an
AnsiString would be another benefit. But these
seem to be just dreams. After all, doesn't
everybody use AnsiString when programming with
the Borland compiler? <sarcasm>
</Off-Topic>
--
Thomas Matthews
C++ newsgroup welcome message:
http://www.slack.net/~shiva/welcome.txt
C++ Faq: http://www.parashift.com/c++-faq-lite
C Faq: http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.learn.c-c++ faq:
http://www.raos.demon.uk/acllc-c++/faq.html
Other sites:
http://www.josuttis.com -- C++ STL Library book
|
|
| Back to top |
|
 |
Tadzio Guest
|
Posted: Sat Feb 28, 2004 2:48 pm Post subject: Re: How to use to_string() from bitset.h |
|
|
Great THANKS from POLAND !!!:)
You helped me. I use now c_str() to convert and everything works.
Maybe you know some exaples of apply bitset.h class (i write licence form
computer science about it)
I will be thankful for that information.
Filip Kasperkiewicz
III year of computer science
University of Maria Curie Sklodowska
|
|
| Back to top |
|
 |
|