c++ - memset pointer + offset -
for example, have:
dword pointer = 0x123456; dword offset = 0xabc;
i want add offset
pointer , set value @ address pointed pointer 1.0f
. how give memset()
pointer , offset first argument?
dwords same uint32_t's. add them other integer.
also, while setting float (i assuming you're setting float due 'f' after '1.0'), wouldn't use memset. cast pointer float, , de-reference so:
dword pointer = 0x123456; dword offset = 0xabc; pointer += offset; float* float_pointer = reinterpret_cast<float*>(pointer); *float_pointer = 1.0f;
Comments
Post a Comment