Linked List Implementation using C++

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;
}
}
};

int main()
{
list l;

l.put_list();

return 0;
}
1) Please use code tags, to make your code readable:

http://www.cplusplus.com/articles/z13hAqkS/

2) What on earth does
got no proper result
mean? If you have a problem with your code, then explain clearly and explicitly what the problem is, so that we can help you fix it.

We're not just going to write your code for you.
linked list has no size limit. your code has.
Topic archived. No new replies allowed.