gpt4 book ai didi

c++ - 声明名为 'this' 的参数时出现语法错误

转载 作者:行者123 更新时间:2023-11-30 00:36:45 25 4
gpt4 key购买 nike

<分区>

typedef struct {
index_tree_node node;
uint32_t number;
lzma_vli block_number_base;
index_tree groups;
lzma_vli record_count;
lzma_vli index_list_size;
lzma_stream_flags stream_flags;
lzma_vli stream_padding;
} index_stream;

函数如下:

static void
index_cat_helper(const index_cat_info *info, index_stream *this) //problem line
{
index_stream *left = (index_stream *)(this->node.left);
index_stream *right = (index_stream *)(this->node.right);

if (left != NULL)
index_cat_helper(info, left);

this->node.uncompressed_base += info->uncompressed_size;
this->node.compressed_base += info->file_size;
this->number += info->stream_number_add;
this->block_number_base += info->block_number_add;
index_tree_append(info->streams, &this->node);

if (right != NULL)
index_cat_helper(info, right);

return;
}

错误:

error C2143: syntax error : missing ')' before 'this'

error C2447: '{' : missing function header (old-style formal list?)

我正在寻找这些错误的来源。

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com