#include "StdAfx.h" #include<iomanip> #include <iostream> using namespace std; class node { int data; public: node *next; node(int d); }; node::node(int d) { data=d; } class Linklist { node *start; node *next; public: Linklist(); void append(int d); }; Linklist::Linklist() { start=NULL; } void Linklist::append(int d) { node *ptr=new node(d); ptr->next=NULL; start=ptr; } int main() { Linklist l; l.append(10); l.append(20); return 0; }
append()
start
cin
cout
ptr1
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)