chapter 7 programming challenge 6 what header file should I

chapter 7 programming challenge 6, what header file should I use or create. It seems as though I should create a seperate .cpp file that defines the Tips class and this should be the header file defined. I do not understand this directive. Is this an actual seperate .cpp file that the program is trying to define?

#include \"stdafx.h\" <---- how do I create this? This is the headerfile that is shown in the sample solution...

I am unsure what this means... the solution does not define this, and my program will not run without a compatible header file. Why isn\'t this included in the steps?

Can someone show me how to create a proper header file?

Solution

#include \"stdafx.h\" is a pre compiled header file.
Basically this is used in Visual Studio
1. To enable pre compiled header files in every configuration of <filename>.cpp files.
It is done on \"pre compiled header\" tab in Visual Studio wizard.
2. set value \"Use (/Yu)\" for \"pre compiled header\" option.
3. set \"stdafx.h\" for \"pre compiled header file\" option.
4. set \"$(IntDir)$(TargetName).pch\" for \"pre compiled header output file\" option.
5. create stdafx.h file and add to the project.
Now we include those headers which we want to be pre processed into this file.
create stdafx.cpp file and add to project. It has only one line: #include \"stdafx.h\".
change settings for stdafx.cpp file in every configuration;
set value \"Create (/Yc)\" for \"pre compiled header\" option.

chapter 7 programming challenge 6, what header file should I use or create. It seems as though I should create a seperate .cpp file that defines the Tips class

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site