我有以下代码片段:基本上我正在尝试使用值集方法从提取函数中获取值。以下是下面的片段
int extract(uint8_t *msg)
{
msg = get_value();
print(msg); // I am able to print the value here.
}
int main()
{
uint8_t msg;
extract(&msg);
print(msg) // Here it is printing incorrect value..
}
我究竟做错了什么?