#include #include #include #include using namespace std; BOOST_STRONG_TYPEDEF(int, tracked_int) template void serialize(Archive &ar, tracked_int & ti, const unsigned int version) { ar & ti; } class linklist { public: static tracked_int node_no; linklist *next; int value; }; namespace boost { namespace serialization { template void serialize(Archive & ar, linklist & g, const unsigned int version) { ar & g.node_no; ar & g.value; ar & g.next; } } // namespace serialization } // namespace boost int aaa = 1; tracked_int linklist::node_no = tracked_int (aaa); int main() { char ch; linklist *start = new linklist; start -> value = 5; start -> next = NULL; linklist *k = start; do { linklist *last = new linklist; ++linklist::node_no; last -> value = 6; last -> next = NULL; k -> next = last; k = last; cout<<" do u want to continue adding more nodes into the link list (y/n) ??"; cin>>ch; } while (ch == 'y'); k = start; while(k != NULL) { cout<< k -> value <next; } cout<<"\nthe number of nodes present in the list = "< value <next; } delete newg; ifs.close(); return 0; }