std::basic_ios<CharT,Traits>::operator!
From cppreference.com
bool operator!() const;
|
||
Returns true if an error has occurred on the associated stream. Specifically, returns true if badbit or failbit is set in rdstate().
Parameters
(none)
Return value
true if an error has occurred, false otherwise.
Example
Run this code
#include <cstdlib>
#include <fstream>
#include <iostream>
int main()
{
std::ifstream file("test.txt");
if