Is there a difference of declaring int *p; or int **p; I know **p is used for a pointer to a pointer but *p can also be assigned to a pointer so my question is there a difference between them?
void main()
{
int numDays;
double sum = 0;
double avg;
cout << "Enter the number of days of sales";
cin >> numDays;
double *Sales = new double[numDays];
double *p = Sales;
for (int i = 0; i < numDays; i++)
{
cout << "enter how much you sold for day " << i << endl;
cin >> *p;
sum = sum + *p;
p++;
}
avg = sum / (numDays);
cout << "the sum is" << sum << endl;
cout << "the avg is" << avg << endl;
delete[]Sales;
why don't we use pointertopointers for a dynamic array such as this in this spot
double *Sales = new double[numDays];
double *p = Sales;
or can you?