Memset Definition and use

memset() is a very fast version of a relatively simple operation:

void* memset(void* b, int c, size_t len) {
    char* p = (char*)b;
    for (size_t i = 0; i != len; ++i) {
        p[i] = c;
    }
    return b;
}

That is, memset(b, c, l) set the l bytes starting at address b to the value c. It just does it much faster than in the above implementation.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)