Diferenças entre edições de "cpp/io/basic ios/exceptions"
Da cppreference.com
m (r2.7.3) (Robô: A adicionar: de, en, es, fr, it, ja, ru, zh) |
m (Use {{lc}}. Update links. Various fixes.) |
||
Linha 1: | Linha 1: | ||
− | {{ | + | {{begin}} |
− | {{ | + | {{| std::ios_base::iostate exceptions() const;}} |
− | {{ | + | {{| void exceptions(std::ios_base::iostate except);}} |
− | {{ | + | {{end}} |
===Parâmetros=== | ===Parâmetros=== | ||
− | {{ | + | {{begin}} |
− | {{ | + | {{| except |{{tr| máscara de exceção| exception mask}}}} |
− | {{ | + | {{end}} |
===Exemplo=== | ===Exemplo=== |
Edição actual desde as 09h04min de 2 de julho de 2013
std::ios_base::iostate exceptions() const; |
||
void exceptions(std::ios_base::iostate except); |
||
[editar] Parâmetros
except | - | máscara de exceção
Original: exception mask The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
[editar] Exemplo
#include <iostream> #include <fstream> int main() { int ivalue; try { std::ifstream in("in.txt"); in.exceptions(std::ifstream::failbit); in >> ivalue; } catch (std::ios_base::failure &fail) { // handle exception here } }