How can I compile 64 bit Applications using g++?

  c++, g++
#include <iostream>

int main()
{
    int x = 5;

    int* ptr = &x;

    std::cout << ptr << "n";
}

I’m trying to compile to 64bit Application
with the command

g++ -m64 *.cpp

but the pointer is always gives me a 32-bit pointer(0x61fe14)
why it is not working
isn’t it suppose to give me something like 0x000000C9128FF9B4
why its compiling it to 32-bit Application

Source: Windows Questions C++

LEAVE A COMMENT