I have a typedef that I'd like to use across multiple files, my question is, what the best way to accomplish that without re-declaring the typedef in each file? Also, it seems silly to me to stick a typedef in it's own header file.
Thoughts???
I have a typedef that I'd like to use across multiple files, my question is, what the best way to accomplish that without re-declaring the typedef in each file? Also, it seems silly to me to stick a typedef in it's own header file.
Thoughts???
goto( comeFrom() );
Put it in a header file.
If you're using a typedef across multiple source files, there's usually something else (eg declarations of functions that accept arguments of the typedef'd type) which would logically be placed in the same header file. If the typedef needs to go alone into a header file, so be it - odds are something else will eventally need to go into that header as well.