📜 ⬆️ ⬇️

C pointers as a linguistic paradox

Recently, an acquaintance whom I know through completely non-programmer circles asked to help him with the laboratory in C ++. The code was about the following:

void do_something(MyObj *input[], int count)
{
    MyObj **copy = new MyObj*[count];
    for (int i = 0; i < count; ++i)
        *copy[i] = *input[i];
    ...
}

, , — , «» , , , . , , — .

, , :



?
, C/C++, .

. , « », . , :


, — — C/C++ :


, .


, (= , , ) . , — .

, : «» «» , «», , .

C/C++: , « T», «T*», ( ), , , , T (, , T&, lvalue ). ( ) ,


? . , - C/C++ . , — … .

')

Source: https://habr.com/ru/post/417257/


All Articles