-
Nubling question
I have a 3rd party header that has a function declaration in it like this -
Code:
static int Foo(FooClass& FooData);
I can't seem to recall what exactly they are wanting passed, it looks like they want the data in FooClass passed, but that doesnt make sense int eh context its used in.
-
O_o
Using my amazing powers of Fu, the function expects you to snarfle the garfax.
Soma
-
FooClass is being passed as a non-const reference, meaning either the interface isn't const-correct or they expect to modify FooData. That would tell me that FooData is an output parameter and you don't necessarily need to pass anything specific in, you just need to provide an object for the function to modify.
-
well the problem is I cant figure out how to create FooData in such a way that I can pass it and then access the contents after the call returns. I tried
Code:
FooClass* FooData = new FooClass();
it refuses to accept a FooClass* as a FooClass&
so how do I create this
-
Uh ...
Code:
FooClass FooData;
Foo(FooData);
-
Here
Code:
FooClass fooData;
Foo(fooData);