EDIT
I am learning C++ through a series of questions from the university I attend. Here is an excerpt of the problem in question:
A retailer shop wishes to store information about its sales. Typical information it wishes to store about a sale are: Sale identification number (a unique number for each sale), customer’s surname and other names as well as the customer’s address. A sale can consist of up to 10 different items, with different quantities of each item. For each item, the sale class should store the item number, item description, unit cost and the number of units of the items purchased as well as the total cost for the item.
TLDR: I am trying to write a constructor for a class which contains an array as one of its attribute.
Background
I am learning about Classes in C++ and am currently trying out interface.
The Code
For the sake of clarity, here is a simplified version of the interface showing only the constructor:
Sale.h
class Sale {
int* products_id[];
public:
Sale(int& products_id[]);
};
Now, the interface needs to be implemented:
Sale.cpp
#include "Sale.h"
Sale::Sale(int& product_id[]) {
this->product_id[] = product_id[];
};
The Problem
For some reasons, my IDE (VS Code) is complaining about an error
no suitable conversion function from "product_id" to "product_id *" exists
I am unable to find any relevant resources online.
I would appreciate it if someone could help me out or at least point me in the right direction. Regards.