I\'ve come across some code that has a large static function in a header file and i\'m just curious when it is/is not ok to do this. For example, if many .c fil
In my experience it is generally a bad idea to define a function in a .h file, and i've never had cause to do so, doing so by accident once caused me no end of headaches.
Though i guess it would allow each file that includes the header to have its own separate implementation of the function which, if the function has static vars, may be the desired behaviour e.g. if you want/need to keep track of some information separately for each file.