- #1
yungman
- 5,718
- 241
I am learning how to create Classes. I already created the Specification file(Rectangle.h) and Implementation file(member function Rectangle.cpp) separately. In the book the CD that came with it supposed to have ways to do it, BUT of cause I bought used and don't have the CD!
I already know how to #include Rectangle.h into the Implementation file. It's simple, just #include ""C:\\Users\\alanr\\Desktop\\C++ exercise\\Gaddis\\inout files\\Rectangle.h" for my directory in the laptop.....BUT it's so clumsy!
In a complete program that use this Class, I have to pull in the Specification file( header file) and Implementation file to use in the program, There must be an easier and cleaner way to do it like we just #include<iostream>, none of the C:\\... stuffs. You guys have a standard way of doing this easier?
Do you create a folder to store all the header files and implementation file and use a special way to call them without having to writhe all the "C:\\..." stuffs?
EDIT: I forgot to say, I know you can physically copy the .h and .cpp file into the program using it. To me, that's even worst than writing "C:\\..." because you actually go and copy and paste every time you write a program that use the Class Object. There got the be a better way.
Thanks
I already know how to #include Rectangle.h into the Implementation file. It's simple, just #include ""C:\\Users\\alanr\\Desktop\\C++ exercise\\Gaddis\\inout files\\Rectangle.h" for my directory in the laptop.....BUT it's so clumsy!
In a complete program that use this Class, I have to pull in the Specification file( header file) and Implementation file to use in the program, There must be an easier and cleaner way to do it like we just #include<iostream>, none of the C:\\... stuffs. You guys have a standard way of doing this easier?
Do you create a folder to store all the header files and implementation file and use a special way to call them without having to writhe all the "C:\\..." stuffs?
EDIT: I forgot to say, I know you can physically copy the .h and .cpp file into the program using it. To me, that's even worst than writing "C:\\..." because you actually go and copy and paste every time you write a program that use the Class Object. There got the be a better way.
Thanks
Last edited: