c - Should the static and inline functions be defined in .h file? -


when write software in c, should put static , inline functions in .h or in .c file?

do not put declaration nor definition of static function (or variable) in .h file. defeats points of static - keeping functions/variables local.

inline matter - depends on scope meant function. inline function in .h meant global usage , scope. inline function in .c meant local usage only. same strategy used #define

inline functions can extern, static or unspecified. @christoph explains inline scope issues.


Comments

Popular posts from this blog

jquery - How do you format the date used in the popover widget title of FullCalendar? -

Bubble Sort Manually a Linked List in Java -

asp.net mvc - SSO between MVCForum and Umbraco7 -