Hello everyone. I am new to c++ and am using C++ Primer 5/e to help me get an understanding of the language. In introduction to classes section in the book, there is a #imclude "Sales_item.h" but it will not be excepted. I am using the newest version of xcode on a MacBook Air, if that helps. Is there any way I can make it except Sales_item.h? Thank you.
No I couldn't figure out how to do that on my Mac, it created its own desperate folder within the same project. Even when I tried to use it in the sewerage folder it wouldn't work because it didn't work on main.
I'm sorry spellcheck really messed me up haha. I meant seperate both times. Really sorry for any mistakes, English isn't my first or second language.
#include <iostream>
#include "Sales_item.h"
int main ()
{
Sales_item book;
std::cin>> book;
std::cout << book << std::endl;
return 0;
}
The problem is the #include "Sales_item.h", apparently the file does not exist.
LOL, you aren't using Apple's auto-correct spell checker are you?
Or are you using an online translator to turn stuff into English?
How did you get main in the folder? On a mac, you really just need to open Finder and find the "Sales_item.h" file, copy it, then navigate over to your program's folder, and paste.
If you are using XCode, you can add the dependency directly in the dependencies list.
Yes I'm using the apple spell check. Could you please write the steps a little more simply and more detailed? Sorry if too much. Where is the dependency list? What do you mean by paste it into my program? How can I enable the main to accept it? Thanks for your help.