The UNIX Forums
"Join the Network of UNIX System Users"


 
Subject: ternary operator
forumrating
Newbie
Rank: 1



UID 149
Digest Posts 0
Credits 0
Posts 113
Reading Access 10
Registered Apr 25, 2007
Status Offline
Post at Jun 20, 2007 10:33 AM  Profile | P.M. 
ternary operator



ternary operator




how do i interpret the following ternary operation?
fn_max(var_type a,var_type b,var_type c)
{
var_type t;
return(t=((t>a?:t;a)>b)?:t;b)>c?:t;c)
}


Top
Visage
Newbie
Rank: 1



UID 24
Digest Posts 0
Credits 0
Posts 57
Reading Access 10
Registered Apr 25, 2007
Status Offline
Post at Jun 20, 2007 10:33 AM  Profile | P.M. 
ternary operator



fn_max(var_type a,var_type b,var_type c)
{
var_type t;
return(t=((t>a?:t;a)>b)?:t;b)>c?:t;c)
}

break the above expresiion as follows.
1. (t>a?:t;a)
2. ((result)>b)?:t;b)
Top
 

 

All times are GMT, the time now is Jul 31, 2010 03:34 AM

Powered by Discuz! 5.0.0  © 2001-2006 UNIX Forums
Processed in 0.004760 second(s), 8 queries

Clear Cookies - Contact Us - UNIX Help - Archiver - WAP