The question is, wether the program you want to hack, accept float values !?
Ok, float values are not given in the memory, there are just values, who "describe" the float value!
The function "WriteProcessMemory" only accepts LPCVOID, i thik this should be a 4 byte value !?
So we have to convert the float number to a 4 byte value:
using namespace std;
float fNumber = 3.141; //type in your number you want to "hack" here
float *pointer = &fNumber; //pointer to this number
int *intpointer = (int *) pointer; //cast to int-pointer
cout<<"Value as float: "<<*pointer<<" Value as 4-byte-integer: "<<*intpointer<<endl;
//you can get now the memory of the float-value as int-value
the value as 4-byte-integer you can type in into the WriteProcessMemory-function
I hope this will work.