; at end of function?

This is a discussion on ; at end of function? within the C++ Programming forums, part of the General Programming Boards category; Is there a reason to have a ; after the } at the end of a function definition? Like Code: ...

  1. #1
    Registered User
    Join Date
    Nov 2008
    Posts
    119

    ; at end of function?

    Is there a reason to have a ; after the } at the end of a function definition? Like

    Code:
    class Foo
    {
      public:
        void Bar();
    };
    
    Foo::Bar()
    {
      //some code
    };

  2. #2
    Registered User
    Join Date
    Dec 2006
    Location
    Canada
    Posts
    3,182
    Doesn't do anything (null statement) and not required. They are only required after class, struct, and union definitions.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 15
    Last Post: 06-09-2009, 02:19 AM
  2. Replies: 2
    Last Post: 02-26-2009, 10:48 PM
  3. Print function: sending a function.. through a function?
    By scarlet00014 in forum C Programming
    Replies: 3
    Last Post: 11-05-2008, 04:03 PM
  4. Replies: 14
    Last Post: 03-02-2008, 12:27 PM
  5. Replies: 9
    Last Post: 01-02-2007, 03:22 PM

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