I am trying to print the address of a data member of a class:
#include <iostream>
struct test { int x; };
int main() {
test t;
std::cout << &t.x << std::endl;
}
The output is:
0x23fe4c
I don't understand how this points to a memory address. I want to know the meaning of this way of representing addresses.
Aucun commentaire:
Enregistrer un commentaire