#include <iostream> using namespace std; struct node{ int data; struct node *link; }; int main(){ struct node* head = new node; head->data=45; head->link=NULL; cout << "new node " << head->data<<endl; struct node* current = new node; current->data = 98; current->link = NULL; head->link = current ; cout << "new node " << current->data<< endl; }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter