首页 > 解决方案 > 预期 'const csim_stats_t * {aka const struct*}' 但参数的类型为 'csim_stats_t * {aka struct*}'

问题描述

如标题所述,我正在尝试初始化变量结果,但出现以下错误

expected 'const csim_stats_t * {aka const struct <anonymous> *}' but argument is of type 'csim_stats_t * {aka struct <anonymous> *}'

因此,我无法在struct csim_stats_t. 有人可以帮忙吗?

我的结构被定义为:

typedef struct {
    long hits;
    long misses;
    long evictions;
    long dirty_bytes;
    long dirty_evictions;
} csim_stats_t;

标签: cstructcompiler-errors

解决方案


推荐阅读