Welcome to Dream.In.Code
Getting C++ Help is Easy!

Join 135,921 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 2,589 people online right now. Registration is fast and FREE... Join Now!




Throwing an exception

 
Reply to this topicStart new topic

Throwing an exception

ibaraku
10 May, 2008 - 02:13 PM
Post #1

D.I.C Head
Group Icon

Joined: 12 May, 2007
Posts: 164



Thanked: 1 times
My Contributions
I am trying to throw an exception in the following statement.
CODE

template <typename K>
void BST<K>::remove(Iterator &pos) throw (BSTException)
{

    typename BST<K>::Iterator iter;
    K target;
    target = *pos;
    remove(target);
    while(!(iter.parents.empty()))
    {
        iter.parents.pop();
    }
    iter.currentNode = NULL;

    
    if(target == NULL)
    {
        throw BSTException("BST Exception: iterator not found");
    }

   // iterator operation
   // Exception : the given Iterator is not found
}


I get a warning saying
Warning: NULL used in arithmatic.
any ideas why???
User is offlineProfile CardPM
+Quote Post

Reply to this topicStart new topic
Time is now: 12/1/08 08:11AM

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month