One problem you have is that the string you are trying to create is not what you are actually creating. You are using \u, that parses as a unicode character (and in you case is invalid anyway). If you are trying to create the raw bytes for 0x3F800000 in memory you should escape them for example like this:
"\x3f\x80\x00\x00"
but that arises the second problem, what kind of endianess you are working on (probably little endian), as you are specifying the raw bytes as a succession in memory you must be aware of that.
"\x3f\x80\x00\x00" will produce 0x3f800000 in big endian
"\x00\x00\x80\x3f" will produce 0x3f800000 in little endian
so changing that line will make your code work (in case you are using a little endian platform)
// char * c = "\u003F\u0080\u0000\u0000";
char * c = "\x00\x00\x80\x3f"; // little endian for float 1
As you tag this question as being C++, I'll mention that you way of reading the raw bytes into a float should be something like this:
char *rawbytes="...";
float f=*reinterpret_cast<float*>(rawbytes);
in case the rawbytes are in a different endianess your system is, you will have to swap the bytes. Is not until C++23 that you have a built in for it, so probably you should go with something like this:
template<typename T, typename std::enable_if<std::is_integral_v<T> && sizeof(T)==4,int>::type=0>
constexpr inline void binarySwap(T &value) {
std::uint32_t tmp = ((value << 8) & 0xFF00FF00) | ((value >> 8) & 0xFF00FF);
value = (tmp << 16) | (tmp >> 16);
}
Of course the byte swap function will depend on the size of the float type you are working on. From your question I'm showing the 32 bit version here.