I was wondering if there was a tool (maybe GNU C++ compiler) to obtain from a .cpp file full of functions a .hpp file with the mentioned functions declarations.
Example:
I have:
magic.cpp
int foo() { return 42; }
char bar() { return 'z'; }
And I would like to obtain this after applying the wonderful tool:
magic.hpp
int foo();
char bar();
On Debian-based distributions:
apt-get install cproto
Then cproto magic.cpp
gives the following output:
/* magic.cpp */
int foo(void);
char bar(void);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With