vendredi 16 septembre 2022

memory steps while defining variable - are they true?

Lets say we are defining a variable :

float myFloat{3};

I assume that these steps are done in memory while defining a variable, but I am not certainly sure.

Initial Assume: Memory is consist of addresses and correspond values. And values are kept as binary codes.

1- create binary code(value) for literal 3 in an address1.

2- turn this integer binary code of 3 to float binary code of 3 in the address2. (type conversion)

3- copy this binary code(value) from address2 to the memory part created for myFloat.

Are these steps accurate ? I would like to hear from you. Thanks..

Aucun commentaire:

Enregistrer un commentaire