answersLogoWhite

0


Best Answer

#include<iostream>

#include<list>

class person

{

std::string m_name;

std:string m_phone;

public:

const char* get_name()const{return( name.c_str() );}

const char* get_phone()const{return( phone.c_str() );}

person(std::string m_name, std::string m_phone) : m_name(name), m_phone(phone) {}

};

int main()

{

std::list<entry*> phonebook;

person* p = new entry("Joe Bloggs","01234 555 6789");

phonebook.push_back(p);

p = new person("Ann Other", "01234 555 9876");

phonebook.push_back(p);

p = new person("Some One", "01234 555 8769");

// and so on...

return(0);

}

User Avatar

Wiki User

10y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Code in c plus plus of phonebook using linked list?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is pseudo code algorithm for create a linked list with a header and insert a four numbers to the list?

pseudo code algorithm to create a linked list


Mini project on employee database using linked list on c language code?

mini project data structure


Can a linked list implemented using an array be accessed by giving the location?

A linked list implemented with an array defeats the purpose of using a linked list, which is to address the memory allocation problems associated with arrays.


Where linked list using?

linked list are used for creation of stack,queues to use memory in optimum manner linked list are used as they are dynamic in nature


Differences linked-list non contiguous allocation and linked-list allocation using index?

ok


Which of the following data structures can be randomly accessed giving loc A. linked list implemented using array B. singly linked list C. double linked list D. both single and double linked list?

Which of the following data structures can be randomly accessed giving loc?A. linked list implemented using arrayB. singly linked listC. double linked listD. both single and double linked listThe answer is A.


Explain Pseudo code for circular linked list?

write pseudocode for link list


Evaluate the polynomial expression using linked list using c?

Evaluating a Polynomial expression using a singly linked list visit : http://myfundatimemachine.blogspot.in/2012/06/polynomial-evaluation-in-c.html


Explain any two advantages using Single linked list over Doubly linked list and vice-versa?

Advantages of single linked list: # Decrease in storage space per linked list node # Simpler implementation Advantages of double linked list # Decrease in work when accessing a random node # Decrease in work when inserting or deleting a node


What is cprogram code to insert a node in single link list?

Write Code to Insert a Node in a Single Linked List at any given Position.


Is it possible to implement stack and queues using linkes list?

Yes it is possible to implement stack and queue using linked list


How do you solve josephus problem using circular linked list?

The Josephus problem is a problem to locate the place for the last survivour. It shows the power of the circular linked list over the singly linked lists.