Can't define a class "sales_item.h"

I've been looking thru the internet and can't find a solution.

I'm stuck in C++ primer book chapter 1, 1.5.1

Program won't run #include "Sales_item.h" with errors
No such a file or directory.

I'm using codeblock.
Help me please.


1
2
3
4
5
6
7
8
9
10
11
#include <iostream>
#include "Sales_item.h"
int main()
{
    Sales_item book; 
    // read ISBN, number of copies sold, and sales price
    std::cin >> book; 
    // write ISBN, number of copies sold, total revenue, and average price
    std::cout << book << std:::endl;
    return 0;
}
Have you created a file named Sales_item.h in the same directory as your source file?
Can you explain what does it mean?
Sorry for being an i-diot.

there is only 1 file call main.cpp in test new book folder.

There are some people say this is not the correct way to define a class.
The error message means that the file "Sales_item.h" doesn't exist. Which means that you haven't created any file with that name.
There are some people say this is not the correct way to define a class.

Perhaps you need to review your documentation on how to properly create and use a class that you design.

http://www.cplusplus.com/doc/tutorial/classes/
Topic archived. No new replies allowed.