埃菲尔铁塔:LINKED_LIST上的未知标识符“光标” [STRING]

时间:2019-01-11 11:59:20

标签: eiffel

我在本地int main(int argc, char ** argv) { //example variables int height = 4; int width = 4; unsigned char image[width][height]; unsigned char *test; //gave the 0th element a basic value image[0][0] = 255; //prints out 'Image = 255' as expected printf("Image = %d\n", image[0][0]); //allocate test some memory test = malloc(height * width * sizeof(char)); //attempt to give test[0] the value of image[0][0] test[0] = image[0][0]; //now prints out '255' printf("Test = %u\n", test[0]); } 上有一个unknown identifier,我真的不明白为什么!

like some_values.cursor

工作

qry_update_set_fields (some_keys, some_values, some_unstored_field_names: LINKED_LIST[STRING]): STRING
    require
        same_some_keys_some_values_count: some_keys.count = some_values.count
    local
        l_val_c: like some_values.new_cursor
    do
        Result := ""
        l_val_c := some_values.new_cursor
        across
            some_keys as l_key_c
        loop
            Result := l_key_c.item + "=" + l_val_c.item + ","
            l_val_c.forth
        end
        if Result.ends_with (",") then
            Result.remove_tail (1)
        end
    ensure
        dont_modify_parameters: old some_keys.is_equal (some_keys) and old some_values.is_equal (some_values)
    end

都不起作用

l_val_c: LINKED_LIST_CURSOR [STRING]

1 个答案:

答案 0 :(得分:1)

该示例尝试使用限定的锚定类型like argument中的参数。不支持。固定在参数上的类型不是标准Eiffel的一部分,仅出于向后兼容的形式受支持,其形式为{{1}}。