cs_helena123
Messages postés22Date d'inscriptionmardi 4 mars 2003StatutMembreDernière intervention25 août 2003
-
30 juil. 2003 à 11:19
cs_vieuxLion
Messages postés455Date d'inscriptionsamedi 26 octobre 2002StatutMembreDernière intervention 6 avril 2004
-
30 juil. 2003 à 18:22
Bonjour, lorsque je lance avec Borland C++ Builder 5, il me dit qu il ne retrouve pas la fonction to_string() alors qu elle est clairement definie dans la librairie ... tout comme la fonction to_ulong() mais qui elle ne pose pas de probleme...
y a un truc ki m echappe ...
cs_Kaid
Messages postés949Date d'inscriptionmardi 2 octobre 2001StatutMembreDernière intervention 8 juillet 20061 30 juil. 2003 à 16:00
Le problème c'est que tu utilises mal cette méthode, voici un exemple copié de la MSDN:
// bitset_to_string.cpp
// compile with: /EHsc
#include
#include
#include <string>
int main( )
{
using namespace std;
bitset<5> b1 ( 7 );
cout << "The ordered set of bits in the bitset<5> b1( 7 )"
<< "\n that was generated by the number 7 is: ( "
<< b1 << " )" << endl;
string s1;
s1 = b1.template to_string<char,
char_traits<char>, allocator<char> >( );
cout << "The string returned from the bitset b1"
<< "\n by the member function to_string( ) is: "
<< s1 << "." << endl;
}