I am getting the above error message when I am trying to convert 'double' to 'float'. I tried typecasting but it did not work. Any help is appreciated.warning C4244: 'argument' : conversion from 'double' to 'float', possible loss of data
I am getting the above error message when I am trying to convert 'double' to 'float'. I tried typecasting but it did not work. Any help is appreciated.warning C4244: 'argument' : conversion from 'double' to 'float', possible loss of data
This is obvious because you are trying to convert a higher level of datatype into lower which may lead you into data loss. This message tells you that the double holds larger amount of data then float can which might result you in data loss. If you still want to move further then it is better to use explicit typecasting.
Basically with this warning, the compiler wants to tell you that since double handles 8 byte of data while float only handles 4 byte of data, the implicit conversion may result you in data loss. If you still want your variable or expression to convert to lower datatype, you need to explicitly mention the proper datatype for typecasting.
Bookmarks