Horje
conditional operator in cpp Code Example
conditional operator in cpp
//(expression 1) ? expression 2 : expression 3
//If expression 1 evaluates to true, then expression 2 is evaluated.
   int x, y = 10;

   x = (y < 10) ? 30 : 40;
   cout << "value of x: " << x << endl; //prints 40
 
   
conditional operator in c++
 // syntax
condition ? inline code for ture condition : inline code for false condition;

3 > 2 ? true : false; // return true




Cpp

Related
move mouse c++ Code Example move mouse c++ Code Example
how to make string get spaces c++ Code Example how to make string get spaces c++ Code Example
remove last index of the string in c++ Code Example remove last index of the string in c++ Code Example
const char to string Code Example const char to string Code Example
unique ptr c++ Code Example unique ptr c++ Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
8