Type Conversion | SoloLearn: Learn to code for FREE!


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)

4/29/2018 9:11:40 PM


2 Answers

New Answer


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


what the output you required... https://code.sololearn.com/c7kXSEXJbW0s/?ref=app run this..