I have created a struct:
struct time
{
int hours;
int minutes;
int seconds;
double total_time;
double price;
time* next;
time* back;
};
I have created 2 pointers to the struct:
time* traverse, head;
I wanted to point the location of head to the same locations as head:
traverse = new time;
head = traverse; // Error here
Why is it that I am getting an error at the assignment?
When writing
the star only affects the first variable. Change your declaration to
and the error should be gone.