How can i return the pointer of the Foo class using its functions. The reason why i ask is because i want to make this code work
Class fo
fo.MakeA(34.5777).MakeY(73.8843);
Thank you very much in advance
Assuming that you need a reference return type;
class foo {
public:
foo& MakeA(float a) {
// MakeA code logic here...
return *this;
}
foo& MakeB(float b) {
// MakeA code logic here...
return *this;
}
}
Otherwise, you can just return a copy (foo
instead of foo&
).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With