iostream - STL C++

clog

Declaration

extern ostream clog;

Description

The clog object is an instantiation of the output stream ostream that controls the stream buffer and is used to output log messages.

Header Include

#include <iostream>

Example

#include <iostream>

int main() {
	using namespace std;

	// We can send any content to clog, just like cout
	clog << "XoaX.net" << endl;

	// However, we usually reserve clog for logging messages
	clog << "Something that we want to log" << endl;

	// Keep the window open
	cin.get();
	return 0;
}

Output

clog Output
 

© 2007–2024 XoaX.net LLC. All rights reserved.