num_put::put
Bir sayıyı bir dizi çevirir CharTypenumarasını gösteren s belirli yerel ayar için biçimlendirilmiş.
iter_type put(
iter_type _Dest,
ios_base& _Iosbase,
_Elem _Fill,
bool _Val
) const;
iter_type put(
iter_type _Dest,
ios_base& _Iosbase,
_Elem _Fill,
long _Val
) const;
iter_type put(
iter_type _Dest,
ios_base& _Iosbase,
_Elem _Fill,
unsigned long _Val
) const;
iter_type put(
iter_type _Dest,
ios_base& _Iosbase,
_Elem _Fill,
Long long _Val
) const;
iter_type put(
iter_type _Dest,
ios_base& _Iosbase,
_Elem _Fill,
Unsigned long long _Val
) const;
iter_type put(
iter_type _Dest,
ios_base& _Iosbase,
_Elem _Fill,
double _Val
) const;
iter_type put(
iter_type _Dest,
ios_base& _Iosbase,
_Elem _Fill,
long double _Val
) const;
iter_type put(
iter_type _Dest,
ios_base& _Iosbase,
_Elem _Fill,
const void * _Val
) const;
Parametreler
_Dest
Bir yineleyici eklenen dizenin ilk öğe adresleme._Iosbase
Çıktı ve çıktıyı biçimlendirmek için bayrak punctuate için kullanılan numpunct tarafı ile locale içeren akış belirtti._Fill
Boşluk için kullanılan karakter._Val
Sayı veya çıkış yapılması Boolean türü.
Dönüş Değeri
Çıkış Yineleyici konumu bir son öğenin ötesindeki adresleri üretilen.
Notlar
All member functions return do_put(_Next, _Iosbase, _Fill, _Val).
Örnek
// num_put_put.cpp
// compile with: /EHsc
#include <locale>
#include <iostream>
#include <sstream>
using namespace std;
int main( )
{
locale loc( "german_germany" );
basic_stringstream<char> psz2;
ios_base::iostate st = 0;
long double fVal;
cout << "The thousands separator is: "
<< use_facet < numpunct <char> >(loc).thousands_sep( )
<< endl;
psz2.imbue( loc );
use_facet < num_put < char > >
( loc ).put(basic_ostream<char>::_Iter(psz2.rdbuf( ) ),
psz2, ' ', fVal=1000.67);
if ( st & ios_base::failbit )
cout << "num_put( ) FAILED" << endl;
else
cout << "num_put( ) = " << psz2.rdbuf( )->str( ) << endl;
}
Gereksinimler
Başlık: <locale>
Namespace: std