Lost Password?


home | tags | Search | Feed
Tag >> C

Ternary Operator CPP

Posted by: MeTh0Dz in ProgrammingComputersC on

A ternary operator is an operator that requires three different parameters/arguments. It is basically used to evaluate an if statement.

Example...

(x == 10) ? (cout << "X equals 10") : (cout << "X does not equal 10");



Basically this says, if x equals ten then print the first message, else print the second message. So it is actually the same as this...

if (x == 10) {
cout << "X equals 10";
}
else {

Statistics

Members Today: 217
Members Online: 5
Users Online: 81
Total Users: 15,197
Total Threads: 10,393
Total Posts: 97,560
Newest Member: JojoAllan

Tutorials

How do I make a [insert standard program assignmen...
OK, you just got your first hard program to build. Maybe it's part of your final project, maybe your teacher is just sadistic. It's hard to tell. Regardless, this thing is BIG. No, really big! No...


C# Tutorial - How To Open New Forms
OK, this question seems to have popped up quite a lot, and it's really quite simple, so here's some details about how to open secondary forms from a main form. Example We have a main form. The u...


Implementing a Fuzzy Set
Before reading this tutorial, be sure to read and . Now we're going to look at fuzzy sets. The key characteristic of this is that every item of interest contains two values: the quantity of interes...