设有如下定义的链表,则值为7的表达式是()
struct st
{
int n;
struct st *next;
} a[3]= {5, &a[1], 7, &a [2], 9, NULL},*p=a; # include "iostream"
using namespace std;
struct st {
int n;
struct st *next;
} a[3] = {5, &a[1], 7, &a[2], 9, NULL}, *p = a;
int main(){
st * node1 = new st;
st * node2 = new st;
st * node3 = new st;
node1->n=5;
node1->next=node2;
node2->n=7;
node2->next=node3;
node3->n=9;
node3->next= nullptr;
st * p1 = node1;
cout<<(++p)->n<<endl;
// cout<<(++p1)->n<<endl;
// cout<<p->next->n<<endl;
cout<<p1->next->n<<endl;
}