Code:
#include <iostream>
using namespace std;
#include <stdlib.h>
struct node
{
int x;
node *next;
};
node *root;
void print(node *l)
{
cout << l->x << endl;
}
void Create(node *l)
{
l=new node;
l->next=NULL;
l->x=5;
}
int main()
{
cout << "==BEGIN==" << endl;
Create(root);
print(root);
cout << "==END==" << endl;
return 0;
}
#include <iostream>
using namespace std;
#include <stdlib.h>
struct node
{
int x;
node *next;
};
node *root;
void print(node *l)
{
cout << l->x << endl;
}
void Create(node *l)
{
l=new node;
l->next=NULL;
l->x=5;
}
int main()
{
cout << "==BEGIN==" << endl;
Create(root);
print(root);
cout << "==END==" << endl;
return 0;
}