• 14
• 12
• 9
• 10
• 13

# Global functions

This topic is 4119 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

##### Share on other sites
// function.cpp : definitionvoid frobnicate() {  // Body};// function.hpp : declarationvoid frobnicate();// user.cpp : usage#include "frobnicate.hpp"void use() {  frobnicate();}

##### Share on other sites
Ah! Thanks, thats clearly one way to do it. Are there any particular reason why I should use .hpp instead of .h?

##### Share on other sites
Quote:
 Original post by MizipzorAh! Thanks, thats clearly one way to do it. Are there any particular reason why I should use .hpp instead of .h?

I use C as well as C++ files in my projects. In particular, the void frobnicate(); line line of code would be interpreted differently by the two languages, so I make sure to mention it's a C++ file. Besides, using .h for C++ files screws up my emacs syntax hilighting (since it expects C files).