0
点赞
收藏
分享

微信扫一扫

strncpy_s 和 strcat_s

腊梅5朵 2022-09-09 阅读 106



char* p_source = "tianzhaixing.bin";
unsigned int len = static_cast<unsigned int > (strlen(p_source) - 4);
char* p_name = (char*) malloc(len);
strncpy_s(p_name, len+1, p_source, len);
strcat_s(p_name, len+5, ".txt");
std::cout << "p_name:" << p_name << std::endl;


strncpy_s 和 strcat_s_malloc


举报

相关推荐

0 条评论