f
X f();
^ ^ function
return type
The function f()
takes no arguments and returns a class object X
.
for example, its definition may be as follows:
class X{
int i;
}
X f(){
X x;
return x;
}
Basically you can use like:
int main(){
X a = f();
int i = f().i;
}
source
share