首页 > 解决方案 > 您如何使用用户关键字“列表”?

问题描述

对于我正在从事的实际工作,我必须为某些功能使用“预设”结构。其中之一如下:

int initEmployees(Employee* list, int len)
{

//From here is my code

    int isError = -1;
    if ( len > 0)
    {
        len--;
        for (int i = 0 ; i < len ; i++)
        {

//This line is the problem, I know is not right but not sure how to fix it
            list[i].isEmpty = 1;

/*My other guesses where:
*(list + i).isEmpty = 1;
(*Employee + i).isEmpty = 1;
but im quiet sure they won't work either*/

        }
        isError=0;
    }
    return isError;
}

尝试谷歌搜索:“代码块用户关键字是否与 STL 相关!” 并通过一本 1991 年的 C 书(西班牙语编辑)检查它是否继续引用任何包含它但没有的库。

标签: ckeyword

解决方案


list不是 C 中的关键字。

请参阅:https ://en.cppreference.com/w/c/keyword


推荐阅读