Functions can return structs like integers or strings. Put the struct type as return type, create a struct inside, then return it. The caller gets a copy of that struct. Example: Point createPoint(int x, int y) { Point p{x, y}; return p; }.
Creates a Point, initializes it, returns it. Call with Point p = createPoint(5, 10);. You can also return directly: return {x, y}; without creating a variable first. The compiler creates a temporary and returns it.
Cleaner when you don't need a local variable.