# Global functions

## 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).

##### Share on other sites
I see. Thanks for the help, rating++ for you. :)

## Create an account

Register a new account

• ## Partner Spotlight

• ### Forum Statistics

• Total Topics
627653
• Total Posts
2978440

• 10
• 12
• 22
• 13
• 33