Ways not to write function headers twice?

Posted by mee on Stack Overflow See other posts from Stack Overflow or by mee
Published on 2010-05-26T13:26:36Z Indexed on 2010/05/26 13:41 UTC
Read the original article Hit count: 217

Filed under:
|
|

Hi,

I've got a C/C++ question, can I reuse functions across different object files or projects without writing the function headers twice? (one for defining the function and one for declaring it)

I don't know much about C/C++, Delphi and D. I assume that in Delphi or D, you would just write once what arguments a function takes and then you can use the function across diferent projects. And in C you need the function declaration in header files *again??, right?. Is there a good tool that will create header files from C sources? I've got one, but it's not preprocessor-aware and not very strict. And I've had some macro technique that worked rather bad.

I'm looking for ways to program in C/C++ like described here http://www.digitalmars.com/d/1.0/pretod.html

© Stack Overflow or respective owner

Related posts about c++

Related posts about c