Original Post
Hello. In the app I am writing I have one class that contains several pointers to other class types, eg: Before creating a Booking object I create the necessary Customer and Payment objects and pass a pointer to these when creating the Booking: and assign them as follows: The problem is this doesn't assign them properly, in debug mode if I hover over 'c' or 'p' then it shows the correct details, however if I hover over 'customer' or 'payment' then random garbage is there. Then later in my code I call functions from customer and payment eg; Now as far as I can tell this function is carried out correctly sometimes, and other times it isn't which really confuses me. Am I doing something silly with my pointers, or should I perhaps not be using them? Thanks in advance
class Booking
{
Customer* customer;
Payment* payment;
}
Booking(Customer* c, Payment* p)
customer = c;
payment = p;
customer->commit();