Dec 9, 2013 at 5:18pm UTC
Hi everybody.
I have a little problem with pointers, i understand them but i dont know how to do this:
I have a pointer to an Address is there a way to save that address value (not the content but the actual address) into a char ?
Dec 9, 2013 at 5:23pm UTC
No, at the very least the address would contain multiple characters.
Dec 9, 2013 at 5:34pm UTC
The PTR of interest is of type DWORD* and where i want to store the address value is a char*, no hope?
Dec 9, 2013 at 5:45pm UTC
Well, that's different. A char* is not a char.
Yes, you can store a pointer to a DWORD as a pointer to a char, if you cast it appropriately.
Of course, that won't change the nature of the data stored at that address. The data will still be appropriate for a DWORD, and attempting to use it as a char by de-referencing the char* will almost certainly cause you problems.
Why do you want to do this?
Dec 9, 2013 at 5:56pm UTC
i have a program (i didnt create it but i have to test it) that has a function that returns a set of attributes from a given address.
something like this: "Attrib(VATY address)"
and the address needs to be a char* (well as i understand as VATY is defined as "typedef char* VATY;").
But for getting the address of interest i have a function that returns it to me but with a DWORD*. (DWORD *WPRPtr;).
I need to pass the WPRPtr (the address that it is pointing to) to the function that recieves the VATY.