How can i write this statement without using the '?' (question mark) in C++ ? sum = carry + (node1 ? node1->data : 0) + (node2 ? node2->data : 0)

后端 未结 0 1042
失恋的感觉
失恋的感觉 2020-11-21 18:34

node1 and node2 are nodes of a linked list.

Node* node1, Node* node2;
int carry = 0;
int sum;
sum = carry + (node1 ? node1->data : 0) + (node2 ? node2->         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题