1

ここにいくつかのCコードがあります:

char *cat_copy(char *dest, char *src)
{
    char *start = dest;

    while (*++dest);    //increment unless it can't anymore.

    while (*src++)
    {
        *dest = *(src - 1);
        dest++;
    }
    return start;
}

while (*++dest)の代わりに、それを機能させるために使用する必要がありwhile (*dest++)ました。

私は読んだ: "--" 演算子 in while() ループと私の心の中では、使用するのが理にかなっていますwhile (*dest++)

で動作しないのはなぜ*dest++ですか? *dest++との違いは何ですか*++dest

4

2 に答える 2