std::setfill
De cppreference.com
|
|
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
<metanoindex/>
<tbody> </tbody>| Déclaré dans l'en-tête <iomanip>
|
||
template< class CharT > /*unspecified*/ setfill( CharT c ); |
||
Lorsqu'il est utilisé dans un
out << setfill(c) expression définit le caractère de remplissage de la out flux de c .Original:
When used in an expression
out << setfill(c) sets the fill character of the stream out to c.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Paramètres
| c | - | une nouvelle valeur pour le caractère de remplissage
Original: new value for the fill character The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
Retourne la valeur
Retourne un objet de type non précisé de sorte que si
out est le nom d'un flux de sortie de std::basic_ostream<CharT, Traits> type, le out << setfill(n) expression se comporte comme si le code suivant est exécuté:Original:
Returns an object of unspecified type such that if
out is the name of an output stream of type std::basic_ostream<CharT, Traits>, then the expression out << setfill(n) behaves as if the following code was executed:The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
out.fill(n);
Exemple
#include <iostream>
#include <iomanip>
int main()
{
std::cout << "default fill: " << std::setw(10) << 42 << '\n'
<< "setfill('*'): " << std::setfill('*')
<< std::setw(10) << 42 << '\n';
}
Résultat :
default fill: 42
setfill('*'): ********42
Voir aussi
gère le caractère de remplissage Original: manages the fill character The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction membre publique de std::basic_ios)
| |
définit l'emplacement des caractères de remplissage Original: sets the placement of fill characters The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction) | |
modifie la largeur de l'entrée suivante / champ de sortie Original: changes the width of the next input/output field The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction) | |