Hey Folks.Iam new to c++.I tried to implement a linked list but got no proper result.Will Any of you suggest me how to properly write my code!Awaiting for answers.
#include <iostream>
#define null 0
#include <cstdlib>
using namespace std;
class list{
private:int key;
list *next;
int i;
public:list(){
next=null;
}
void put_list()
{
cout<<"Please enter the no ofnumbers\n";
int n,a[10];
cin>>n;
cout<<"Please Enter the numbers\n";
for( i=0;i<n;)
{
cin>>key;
next->i++;
key=a[i];
}
cout<<"the list is"<<endl;
for(int j=0;j<n;j++)
{
cout<<a[j];
cout<<endl;
}
}
};