Answers for "c++ iostream example"

0

iostream library in cpp

// iostream_cerr.cpp
// compile with: /EHsc
#include <iostream>
#include <fstream>

using namespace std;

void TestWide( )
{
   int i = 0;
   wcout << L"Enter a number: ";
   wcin >> i;
   wcerr << L"test for wcerr" << endl;
   wclog << L"test for wclog" << endl;
}

int main( )
{
   int i = 0;
   cout << "Enter a number: ";
   cin >> i;
   cerr << "test for cerr" << endl;
   clog << "test for clog" << endl;
   TestWide( );
}
Posted by: Guest on March-04-2020
0

file reading c++

int a, b;
    
ifstream bd; 
myfile.open("file.txt");

if (myfile.is_open())
	while (bd >> a >> b)
    	cout << a << b << endl;

else cout << "ERROR";
Posted by: Guest on November-06-2020
0

iostream c++

#include <iostream>
std::cin
std::cout
Posted by: Guest on June-05-2021

Browse Popular Code Answers by Language