you will need to convert your float to a char*.
there are several ways to do this:
C:
Code:
#include <stdio.h>
// this code doesn't check for overflows. could be bad.
char szBuffer[32];
// copy the float into the buffer as astring
sprintf(szBuffer, "%f", size);
MessageBox(NULL, szBuffer, "Size", MB_OK);
C++
Code:
#include <sstream>
// this code will not overflow.
std::stringstream sBuffer;
// insert the float into the buffer
sBuffer << size;
// .str() returns a string, .c_str() returns a const char*
MessageBox(NULL, szBuffer.str().c_str(), "Size", MB_OK);
clever boost library usage :P
www.boost.org
Code:
#include <boost/lexical_cast.hpp>
#include <string>
MessageBox(NULL, boost::lexical_cast<std::string>(size).c_str(), "size", MB_OK);