I'm using the C++ Primer 5th Edition to learn C++ and I'm stuck on a problem involving classes.
At this point I haven't learned how to create my own classes yet and I am supposed to download the Sales_item class and use it to write my program.
I have it downloaded but I do not know where to put it to make it work. I'm using Microsoft Visual Studios Express 2012.
I tried adding the Sales_item.h header, but it says it cannot open source file for Sales_item.h. Where do I put all the other stuff that comes with the class?
Make sure that the directory in which you include your file is the correct one. If it says it cannot open the source of header files, it is most likely because it cannot find it.
Oh, i really wish books wouldn't ask you to use something before they've given you the knowledge of what it is you're using.
Put it in the same folder as the rest of your source files for that project. The directory you mentioned looks accurate.
Then just add an existing file to the project from inside Visual Studio.
I just looked over those files that I downloaded and most of them are the answer key to the previous problems. I thought everything was linked to the Sales_item.h. I was like "wtf, you need all this to make a class?" lol
Kevin145, remember that at 'some' point, you'll want to keep all of those "Types" of files separate - usually in their own files;
OBJ, BIN, CPP, EXE, H, -should all be kept in their own folders - and then have your IDE ( VS2013?) point to them ( or sometimes your code will point to them). Getting 100-200 ( or 500-800) files all in one folder, most with nearly the exact same name gets to be a real headache real fast.