return cur == NULL ? -1 : cur->val; (I am confused for this c++ sentence) : <pre><code>    /** Helper function to return the index-th node in the linked list. */
SinglyListNode* getNode(int index) {
    SinglyListNode *cur = head;
    for (int i = 0; i &lt; index &amp;&amp; cur; ++i) {
        cur = cur-&gt;next;
    }
    return cur;
}
/** Helper function to return the last node in the linked list. */
SinglyListNode* getTail() {
    SinglyListNode *cur = head;
    while (cur &amp;&amp; cur-&gt;next) {
        cur = cur-&gt;next;
    }
    return cur;
}
/** Get the value of the index-th node in the linked list. If the index is invalid, return -1. */
int get(int index) {
    SinglyListNode *cur = getNode(index);
    return cur == NULL ? -1 : cur-&gt;val;
}
</code></pre>

<hr>

<p>This “ return cur == NULL ? -1 : cur->val; ”</p>

<p>I confused this syntax, can someone separate this sentence?</p>
