Differnce between defining a variable of a class or directly passing parameters to it

So i know my question sounds hell confusing but i ll here give you more detail so for example
FRotator rot = FRotator(0,5,90);
//OR
FRotator rot(0,5,90)
So i tested both and both seems to be working and i am confused which one to use and what are the differences in both
Thanks in Advance

#include “stdafx.h”

class FRotator
{
public:

	FRotator() = default;   // first constructor
	FRotator(float y , float p, float r): yaw(y),pitch(p),roll(r){} // second constructor

private:

	float yaw = 0.0;
	float pitch = 0.0;
	float roll = 0.0;

};

int main()
{
	FRotator(0,0,0); // call second constructor and creates an in instace of FRotator class but where to store that object????

	FRotator rot;  // creates an instance of FRotator class and default initializes using first constructor. so rot is (0.0 ,0.0 , 0.0)

	FRotator rot2(1, 1, 1); // creates an instance of FRotator class named rot2 uning second constructor so rot2 is (1,1,1)
	rot = rot2; // rot is also (1,1,1)

	FRotator rot3 = FRotator(2, 2, 2); // first creates an instance of FRotator class using first constructor, so rot3 is (0,.0,0) then calls second constructor and creates another instance and assigns that to rot3. so rot3 gets (2,2,2)


    return 0;
}

study code comments :wink:

you can copy past it to a fresh VS project and use it yourself

there are situations that maybe one of methods is the only choice.
but personally I have not come across such critical situation :)))

imagine you have 10 constructors and you define a single instance and want to assign different values using constructors.

FRotator rot;
rot= FRotator(0.0.0);
rot=FRotator(0);
rot=FRotator(true);
rot=FRotator(istream &);

thats all I know. but as you said your first method uses more memory

Thanks alot for clearly explaining everything. Just one more thing is there a particular situation to use one way and not the other or we can use both ways (examples in my question) in any case? I think the second one uses more memeory as it creates two instances?