Opp Concept
-
Hello all, I m having three different Link-list say apple,mango,banana. I need to implement common delete function for all the link-list. Is it possible? Thank You...
-
Hello all, I m having three different Link-list say apple,mango,banana. I need to implement common delete function for all the link-list. Is it possible? Thank You...
yes.
You need to google first, if you have "It's urgent please" mentioned in your question. ;-)_AnShUmAn_
-
yes.
You need to google first, if you have "It's urgent please" mentioned in your question. ;-)_AnShUmAn_
ok, how we can do this? can u explain please?
-
ok, how we can do this? can u explain please?
One way is to do it using the friend function
You need to google first, if you have "It's urgent please" mentioned in your question. ;-)_AnShUmAn_
-
Hello all, I m having three different Link-list say apple,mango,banana. I need to implement common delete function for all the link-list. Is it possible? Thank You...
make the link list a template class say. class listList { } T can be apple, mango, banana and override the delete function of the class of list
-
Hello all, I m having three different Link-list say apple,mango,banana. I need to implement common delete function for all the link-list. Is it possible? Thank You...
Yes, so long as your three linked lists all provide the same interface (and while we're here - if you're not using the standard libraries list template, then why not?). You can use a template function, like so:
template<class ListType>
void DeleteTheList(ListType& list)
{
// Do what you need to delete the list
}Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p