This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

怎么将数据放在指定的内存地址

我打算将一幅图像读到指定地址的内存中去,代码如下
FILE* file = fopen("D:\\123.bin", "rb"); //图像文件
unsigned short* data = (unsigned short*)malloc( 640 * 512 * 2); //分配空间
fread(data, 2, 640 * 512, file); //读取文件
现在发愁的是怎么让data这个指针指向特定的内存空间
我用data=(unsigned short*)0x80000000 (ddr的首地址)发现不好使请问怎么做才好

并且我用printf("data adress is %x\n",data);来取得指针的地址,每次运行的时候data指向的地址是固定的,我不能改变。


另外请问大家怎么获取指定内存地址里面的值,比如我想读取0x8000000出内存地址的值