C++ Print Function: Using Cout

There is no built-in print function in C++, but you can use cout to output content to the console. cout is an output stream object in the C++ standard library, and you can use the << operator to output content to the console.

For example:

#include <iostream>

int main() {
    std::cout << "Hello, World!" << std::endl;
    return 0;
}

The code above will print “Hello, World!” to the console. It also uses endl to create a new line.

bannerAds