C++ function declaration

This is a discussion on C++ function declaration within the C++ Programming forums, part of the General Programming Boards category; I was looking an exception header and saw this: virtual const char* what() const throw(); What bizarre thig is that? ...

  1. #1
    Disturbed Boy gustavosserra's Avatar
    Join Date
    Apr 2003
    Posts
    244

    Exclamation C++ function declaration

    I was looking an exception header and saw this:

    virtual const char* what() const throw();

    What bizarre thig is that?
    I only know: virtual const char* what();
    But what does that const throw();?
    Nothing more to tell about me...
    Happy day =)

  2. #2
    The Defective GRAPE Lurker's Avatar
    Join Date
    Feb 2003
    Posts
    949
    const declares that the arguments are not to be changed. Also, const functions cannot call non-const functions. Throw() means this function cannot throw any exceptions.
    Do not make direct eye contact with me.

  3. #3
    Disturbed Boy gustavosserra's Avatar
    Join Date
    Apr 2003
    Posts
    244

    Talking

    Thanks a lot!
    Nothing more to tell about me...
    Happy day =)

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Seg Fault in Compare Function
    By tytelizgal in forum C Programming
    Replies: 1
    Last Post: 10-25-2008, 03:06 PM
  2. doubt in c parser coding
    By akshara.sinha in forum C Programming
    Replies: 4
    Last Post: 12-23-2007, 12:49 PM
  3. <Gulp>
    By kryptkat in forum Windows Programming
    Replies: 7
    Last Post: 01-14-2006, 12:03 PM
  4. Problem with Visual C++ Object-Oriented Programming Book.
    By GameGenie in forum C++ Programming
    Replies: 9
    Last Post: 08-29-2005, 11:21 PM
  5. structure vs class
    By sana in forum C++ Programming
    Replies: 13
    Last Post: 12-02-2002, 06:18 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21