Is there a way of passing values gotten from a function into a fields of a struct?

Lets say you got a function that returns sum and square of some numbers.
How can I assign those values to the new made struct?

struct Struct

{

int sum_from_func;
int square_from_func;

};