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>| Definido no cabeçalho <iomanip>
|
||
template< class CharT > /*unspecified*/ setfill( CharT c ); |
||
Quando utilizado num
out << setfill(c) expressão define o caracter de preenchimento do out fluxo para 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.
Parâmetros
| c | - | novo valor para o caractere de preenchimento
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. |
Valor de retorno
Devolve um objecto de tipo não especificado de tal forma que se
out é o nome de um fluxo de saída de std::basic_ostream<CharT, Traits> tipo, então a expressão out << setfill(n) se comporta como se o seguinte código foi executado: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);
Exemplo
#include <iostream>
#include <iomanip>
int main()
{
std::cout << "default fill: " << std::setw(10) << 42 << '\n'
<< "setfill('*'): " << std::setfill('*')
<< std::setw(10) << 42 << '\n';
}
Saída:
default fill: 42
setfill('*'): ********42
Veja também
gerencia o caractere de preenchimento 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. (of std::basic_ios função pública membro)
| |
define o posicionamento dos caracteres de preenchimento 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. (função) | |
muda a largura da próxima entrada / saída de campo 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. (função) | |