Answers for "conditional cout in c++"

C++
1

conditional cout in c++

int cheese = 0;

// Example of a simple ternary with output stream operators.
std::cout << (cheese ? "We have cheese." : "+++Out of Cheese Error+++") << std::endl;
Posted by: Guest on May-31-2021

Browse Popular Code Answers by Language