Doubt in prototype declaration.

Discussion in 'C++' started by mthread, May 12, 2008.

  1. mthread

    mthread Guest

    Hi,
    I came across this prototype declaration

    virtual const char* what() const throw()

    I would like to know what is the purpose of last two words 'const
    throw()'
     
    mthread, May 12, 2008
    #1
    1. Advertising

  2. mthread

    gnuyuva Guest

    On May 12, 10:45 am, mthread <> wrote:
    > Hi,
    > I came across this prototype declaration
    >
    > virtual const char* what() const throw()


    'const' associated with the function declaration (in a class) promises
    that this function is not going to alter any of the non-static class
    members(data). 'throw()' says that this function won't throw any
    exception. You can also refer to your favourite C++ book.
     
    gnuyuva, May 12, 2008
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Bob Nelson

    doubt about doubt

    Bob Nelson, Jul 28, 2006, in forum: C Programming
    Replies:
    11
    Views:
    659
  2. June Lee
    Replies:
    2
    Views:
    843
    Jim Cobban
    Apr 13, 2008
  3. Replies:
    9
    Views:
    228
    Thomas 'PointedEars' Lahn
    May 26, 2006
  4. Replies:
    3
    Views:
    287
  5. javascript fish
    Replies:
    0
    Views:
    194
    javascript fish
    Oct 11, 2008
Loading...

Share This Page