(condition) ? (if_true) : (if_false)
(condition) ? (if_true) : (if_false)
int time = 20;
string result = (time < 18) ? "Good day." : "Good evening.";
cout << result;
Code Example |
---|
Cpp :: split vector in half cpp |
Cpp :: string to size_t cpp |
Cpp :: C++ red text output |
Cpp :: prime number generator c++ |
Cpp :: for loop vector |
Cpp :: check compiler version c++ |
Cpp :: how to print hello world in c++ |
Cpp :: qt qchar to char |
Cpp :: sum vector c++ |
Cpp :: erosion and dilation c++ |
Cpp :: is there an algorithm to create a truly random password |
Cpp :: how to type hello world in c++ |
Cpp :: ue4 find component c++ |
Cpp :: c++ while loop decrement |
Cpp :: c++ double to string |
Cpp :: how to delete a 2d dynamic array in c++ |
Cpp :: rotate in cpp |
Cpp :: min heap in c++ |
Cpp :: if not defined c++ |
Cpp :: finding no of unique characters in a string c++ |
Cpp :: winmain example |
Cpp :: prime number in c++ |
Cpp :: float max value c++ |
Cpp :: arduino notone |
Cpp :: find length of array c++ |
Cpp :: c++ evaluate expression |
Cpp :: count word accurances in a string c++ |
Cpp :: random number in a range c++ |
Cpp :: how to convert int to std::string |
Cpp :: loop through a vector in c++ |