Can we do like that in C++ | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Can we do like that in C++

(t1->data <= t2->data) ? (list=t1 && t1=t1->next) : (list=t2 && t2=t2->next); A ternary operation in which I wanted to do two task simultaneously with logical AND operator (&&). Here t1, t2, list are pointers of a structure node type. And the structure of node is: struct Node { int data; struct Node *next; }

26th Mar 2017, 11:10 AM
Rax
Rax - avatar
1 Answer
0
you most certainly can do this
26th Mar 2017, 12:58 PM
Sailesh Kumar
Sailesh Kumar - avatar