Inline functions?

Discussion in 'C Programming' started by bill, Apr 30, 2009.

  1. bill

    bill Guest

    If I inline a function must I also use the inline keyword in the function
    prototype?



    Like this:



    /* My H file */

    inline void do_stuff(void); /* Prototype */



    /* My C file */

    inline void do_stuff(void)

    {

    /* do stuff here */

    }
     
    bill, Apr 30, 2009
    #1
    1. Advertising

  2. bill

    Ian Collins Guest

    bill wrote:
    > If I inline a function must I also use the inline keyword in the function
    > prototype?


    No. Don't forget the keyword is only a hint, it does not force the
    function to be inline.


    --
    Ian Collins
     
    Ian Collins, Apr 30, 2009
    #2
    1. Advertising

  3. bill

    bill Guest

    "Ian Collins" <> wrote in message
    news:...

    > No. Don't forget the keyword is only a hint, it does not force the
    > function to be inline.


    Thank you.
     
    bill, Apr 30, 2009
    #3
    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. Abhi
    Replies:
    2
    Views:
    766
    E. Robert Tisdale
    Jul 3, 2003
  2. Replies:
    3
    Views:
    492
  3. Daniel Vallstrom
    Replies:
    2
    Views:
    2,050
    Kevin Bracey
    Nov 21, 2003
  4. jamihuq

    converting inline functions to C functions

    jamihuq, May 16, 2006, in forum: C Programming
    Replies:
    7
    Views:
    364
  5. Rahul
    Replies:
    3
    Views:
    480
    James Kanze
    Feb 28, 2008
Loading...

Share This Page