Lets say in main() I create an object pointer called BOB from a class called TheBuilder and I do this like this
TheBuilder *BOB = new TheBuilder();
Now lets say I have a function that I want to pass this to called helloWorld inside of main. How do I pass this BOB pointer to TheBuilder object? How do I call it and what does the parameter list for helloWorld() look like?
I want to be able to modify data inside of the object that BOB is pointing to inside of the member function helloWorld.
I know it probably has some ‘*’ or ‘&’ but I don’t know where to put them.
Thanks
1 Answer