I have a float that I want to display on a messagebox, which gets LPCSTR type. I tried (char *)&i but it didnt work. (i is the float). How can it be done??
Thank you
I have a float that I want to display on a messagebox, which gets LPCSTR type. I tried (char *)&i but it didnt work. (i is the float). How can it be done??
Thank you
Indeed.I tried (char *)&i but it didnt work.
sprintf(buff, "The Value Is: %.2f", myFloat);
Maybe that is why most OOP languages (.net and java) read all user input into strings as the first state of the input.
it worked, thank you. i didnt know sprintf could do that.