Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有以下代码:
volatile unsigned int * address; char * array="0x10000008";
请告诉我,将“数组”值写入“地址”变量的正确方法是什么?
你可以使用sscanf:
sscanf
#include <stdio.h> sscanf(array, "%p", &address);
或strtoull:
strtoull
#include <stdlib.h> address = (unsigned int *)strtoull(array, NULL, 0);