how can I pass an object as an argument to a function. My knowledge of C++ is NULL but I do cope well with C so please accept my apologies if my question is rubbish. Basically here is my problem. Suppose there is a class call FooClass with some kind of contructor for two integers. In order to create an object I guess I would do something like
Now I want to pass my Foo object by reference into a function called bar.
I would normarlly do something like
but I guess the above is completely wrong.... my compiler in any case is complaining (g++), as I think there is no constructor..... the thing is taht I don't want to create a new object but tell the bar function to expect a FooClass object.
Both google search and looking in the forum failed, mainly becayse I am not sure I am asking the question right....