c++define Node class +7 instances +pointer

my github has my tested code shows a concise syntax:

struct Node{
  int const val; Node * next;
  Node (int payload, Node* n=NULL): val(payload), next(n){}
} _1('1'), //tail
_2('2', &_1),
_3('3', &_2),
_4('4', &_3),
_5('5', &_4),
_6('6', &_5),
_7('7', &_6),
* head = &_7; 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s