number in hexadecimal

I need help i wont to try something like this

1
2
3
int a = 5;

string hex = a << hex;
Last edited on
 
std::cout << std::hex << my_number << "\n";
Yes but i wont to do this

1
2
3
4
5
6
7
int a = 5;

address = a in hexidecimal ?

ReadProcessMemory(hProc, address, &nVal, (DWORD)sizeof(nVal), NULL);

cout << nVal << endl;
Last edited on
A number's value does not change when it is represented using a different base.

Edit: please use code tags.
Last edited on
yes but how to int addres = a in hexidecimal ?
Last edited on
1
2
3
4
5
6
7
8
9
10
11
12
for(NOS;NOS <= trazido;NOS+=4)
    {
        ofstream provera("SveProvereneAdrese\\ML1.txt");
        provera << hex  << NOS << endl;
        provera.close();
        fstream MemoryAddress("SveProvereneAdrese\\ML1.txt");
        LPVOID linee;
        MemoryAddress >> linee;
        cout << linee << endl;
        ReadValue(linee,app.c_str());
        MemoryAddress.close();
    }

here is my code
do you see i use ofstream and fstream to convert int nos value in hexedecimal
Last edited on
int address = a
Because 5 in decimal is the same value as 5 in hexadecimal, which is the same value as 0000 0101 in binary, which is the same value as 12 in ternary, and so on.

You don't need to care how the number is represented. The number is the same value no matter how you choose to represent it.
Last edited on
here is my problem i trying this

int a = 10 // 10 in hexadecimal = c
how to do
this LPVOID addres = a in hexadecimal
Last edited on
Use code tags, please.

Since `a' is an integer, you need to type-cast it to a void pointer.

Number bases have nothing to do with it.

LPVOID address = reinterpret_cast <void*> (a);
Last edited on
Man its WORKS :DDDDDDDDDDD
ty <3
Topic archived. No new replies allowed.