C++Talk.NET Forum Index C++Talk.NET
C++ language newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to use to_string() from bitset.h

 
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ language (comp.lang.c++)
View previous topic :: View next topic  
Author Message
Tadzio
Guest





PostPosted: Fri Feb 27, 2004 6:33 pm    Post subject: How to use to_string() from bitset.h Reply with 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


Back to top
Thomas Matthews
Guest





PostPosted: Fri Feb 27, 2004 9:33 pm    Post subject: Re: How to use to_string() from bitset.h Reply with quote



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





PostPosted: Sat Feb 28, 2004 2:48 pm    Post subject: Re: How to use to_string() from bitset.h Reply with quote



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

Quote:



Back to top
Display posts from previous:   
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ language (comp.lang.c++) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.