Using memset for integer array in C

前端 未结 10 1706
遇见更好的自我
遇见更好的自我 2020-11-27 02:20
char str[] = \"beautiful earth\";
memset(str, \'*\', 6);
printf(\"%s\", str);

Output:
******ful earth

Like the above use of memset, can we initial

10条回答
  •  眼角桃花
    2020-11-27 03:00

    Actually it is possible with memset_pattern4 (it sets 4 bits at a time).

    memset_pattern4(your_array, your_number , sizeof(youre_array));

提交回复
热议问题