Answer the question
In order to leave comments, you need to log in
What can be written in C++ header files?
What can be written in header files? I know I can declare a function there, but can I define it there and call it from there?
Answer the question
In order to leave comments, you need to log in
Functions cannot be defined in header files, except for inline (in particular, class methods) and template ones. Otherwise, sooner or later, a linking error will occur.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question