c - C程序中如何存储变量值?

标签 c arrays pointers interrupt scanf

内核变量:

s32 remainder;
s64 quotient ;
<小时/>

如何在 C 程序中读取上述变量值并将其存储在下面的变量中?

uint32 InterruptLatency;

我正在从内核读取时间,它与 s32 和 s64 类型不同,为 1.3456;

如何在用户端程序上读取此内容?

uint32 InterruptLatency;
uint8 measurements[32];
char buf[256];
int kernelinterrupt time()
{
    fscanf(fp, "%lu", &InterruptLatency);  // I am reading the data from kernel which is not shown here
    measurements[17] = InterrupLatency;

    // after storing it in buffer I am sending the data from but to another layer
}

是否可以读取变量值(s64 和 s32)并将其存储在 uint32 中断延迟中?

最佳答案

使用strcpy复制字符串。运算符 = 不适用于字符串。

关于c - C程序中如何存储变量值?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23336896/

相关文章:

c - 'For loop' 以升序排列数字。 [错误] 指针和整数比较

c - 24bpp 到 8bpp 转换 C 与原始图像数据

c - 从类型 ‘memstruct’ 分配给类型 ‘int’ 时的类型不兼容

python - Python 中的实例变量不像我想象的那样

c - C语言中,(数组名)和&(数组名)有什么区别?

C++:指向结构中成员函数的指针

c - 我不明白这一步,特别是在合并排序中

c - F_mount 函数不适用于 STM32F401ReTx

php - 如何从数组中删除相同的值

javascript - 将两个文档元素数组添加到一个数组中的最佳方法是什么?