Proper way to empty a C-String

前端 未结 6 1879
孤城傲影
孤城傲影 2020-12-04 15:12

I\'ve been working on a project in C that requires me to mess around with strings a lot. Normally, I do program in C++, so this is a bit different than just saying string.e

6条回答
  •  悲哀的现实
    2020-12-04 16:07

    I'm a beginner but...Up to my knowledge,the best way is

    strncpy(dest_string,"",strlen(dest_string));
    

提交回复
热议问题