hey guys,
i need help with understandind this code-actually just some parts of it. can you explain to me what the purpose of this is:
*(float*) variable = 34;
i can understand the variable = 34 part just not the *(float*) part. what does it do?
also what is the function of this: (DWORD*)
in this code
#define variable 0x00CB11C8
(some variable/pointer) = (DWORD*)variable

i think this code is from MFC (microsoft foundation class)
any help is appreciated

Recommended Answers

All 2 Replies

>>*(float*) variable = 34;

It is typcasting variable into a float *, then assigning the value 34 to it.

DWORD* is doing something similar to above. DWORD is defined by Microsoft's windows.h to be unsigned long;. So its the same as (unsigned long *)

I've studied MFC a lot and have never seen this: If it exists, please tell us where you found that. Maybe some very very old 16-bit code?

#define variable 0x00CB11C8
(some variable/pointer) = (DWORD*)variable

>>*(float*) variable = 34;

It is typcasting variable into a float *, then assigning the value 34 to it.

Correction: through it.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.