c - <string.h> 中的 strset 函数,C

标签 c string.h

我学C语言的时候,听说过C语言中的strset函数。

但是,我在最新版本的 C 中找不到它。

被删了吗?如果被删除了,为什么会被删除?

最佳答案

strset 仍然存在。 VS 2017 - _strset_s

#include <stdio.h>
#include <string.h>
int main() {
    char text[] = "Test Code";
    _strset_s(text, sizeof(text), '*');
    printf("%s\n", text);
}

结果 :************

“文本代码”共 9 个字符。 所以输出九个('')

_strset_s(char *_Destination, size_t_DestinationSize, int _Value)

关于c - <string.h> 中的 strset 函数,C,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50657125/

相关文章:

c - #include <string.h> -> 中止陷阱 : 6?

string-comparison - strcmp() 为相同的字符串比较返回不同的值

c++ - C++ 中的参数和函数问题

c - 除了/dev/input/eventx 之外,是否有更高级别(字符?)的方式来访问 Linux 键盘?

C编程;通过有限状态机程序识别字符模式

c - 我不明白 strcmp 结果

c - 绑定(bind)在 UDP 端口上返回失败

c - 在 C 中递归地反转多个用户输入

c - 在字符串 C 指针中循环时出现段错误