+ 8

Type Conversion

In this code I have done Type Conversion using old C language way. When i run this code it gives an error which you can see by running the code. If you know the solution to that please let me know, error in line no : 26,27,28 https://code.sololearn.com/cbRXI7ci5zqa (Note : This code runs perfectly on code blocks)

29th Apr 2018, 9:11 PM
Tanay
Tanay - avatar
2 odpowiedzi
+ 11
Arun Tomar I have printed out the value of offsets and new values of x , y and z. which I didn't get in the output screen. Output that I am expecting is : Vector3 after Initialization : Value of X is : 2 Value of Y is : 3 Value of Z is : 1 Offset values of variables : Offset of X : 4 Offset of Y : 8 Offset of Z : 0 By Changing Structure by using Type punning and offsets : Value of X is : 5 Value of Y is : 6 Value of Z is : 7
30th Apr 2018, 2:50 AM
Tanay
Tanay - avatar
+ 1
what the output you required... https://code.sololearn.com/c7kXSEXJbW0s/?ref=app run this..
29th Apr 2018, 9:40 PM
Arun Tomar
Arun Tomar - avatar