+ 3
I have a few question about structs.
What is the meaning of struct example* function()? What kind of a function we had defined?
1 Antwort
+ 9
Consider:
#include <iostream>
struct example
{
example* func()
{
return this;
}
// This is a function which returns the address of its own instance of the structure.
};
int main() {
example obj;
std::cout << obj.func();
return 0;
}