it is the equivalent of Iif in VB
it is called the ternary operator...
here is an example:
basically, if x > y then z = x, otherwise, z = yCode:#include <iostream.h> int main() { int x,y,z; cout << "Enter 2 numbers: \n"; cout << "First:"; cin >> x; cout << "Second:"; cin >>y; cout << "\n\n"; z = (x > y) ? x : y; cout << "z= \t" << z << "\n"; return 0; }
does that help?
Amon Ra




Reply With Quote