japh wrote:
I just started learning c++ and am at the point of using:
#include "myclass.cpp"
instead of having the class definition in the main file. But I am
getting this warning at compile time:
cat.cpp:4:19: warning: extra tokens at end of #include directive
The program compiles and runs fine, but the warning is puzzling and
concerns me. A google search returned lots of matches but no
solutions...
Any ideas? thanks
You'd put the interface/declarations in say "myclass.h" and include
that. The definitions are in "myclass.cpp" and get added to your compile
( and link ) list for the project.
<aside>
ISO/IEC 14882:1998(E) © ISO/IEC
16.2 Source file inclusion
..
..
5 The mapping between the delimited sequence and the external source
file name is implementation defined. The implementation provides unique
mappings for sequences consisting of one or more nondigits (2.10)
followed by a period (.) and a single nondigit. The implementation may
ignore the distinctions of alphabetical case.
<end aside>
--
Cheers
--
Hewson::Mike
"This letter is longer than usual because I lack the time to make it
shorter" - Blaise Pascal