bzero 和 memset效率比较

版权声明:©1995-2018 CodingTheFuture, blog. All rights reserved. https://blog.csdn.net/sunqian666888/article/details/81004735
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc, char **argv)
{       
        char operator[1024]; 
        unsigned long long i = 0;
        for(i=0;i<1000000000;i++)
        {       
                bzero(operator,sizeof(operator));
                //memset(operator,0,sizeof(operator));
        }
        printf("we use bzero");
        //printf("we use memset");
        return 0;
}
发现memset效率高于bzero


猜你喜欢

转载自blog.csdn.net/sunqian666888/article/details/81004735