#include<iostream>
#include<string>
using namespace std;
struct list ///create a structure for linked list
{
int value;
struct node *next;
};
typedef struct list Node; ///create a Node Type structure Variable
int main()
{
Node *a; ///node type variable
a = new Node(); ///create space for new node
a->value = 10; ///save value
a->next = NULL; /// save address as null
cout << "Data: " << a->value <<"";
cout << "Address: " << a->next << "";
return 0;
}
Output
Data: 10
Address: 0
Add your comment