Which string manipulation functions should I use?

后端 未结 6 811
暗喜
暗喜 2021-02-13 00:01

On my Windows/Visual C environment there\'s a wide number of alternatives for doing the same basic string manipulation tasks.

For example, for doing a string copy I coul

6条回答
  •  悲&欢浪女
    2021-02-13 00:21

    I'd answer this question slightly different. Do you want to have portable code or not? If you want to be portable you can not rely on anything else but strcpy, strncpy, or the standard wide character "string" handling functions.

    Then if your code just has to run under Windows you can use the "safe string" variants.

    If you want to be portable and still want to have some extra safety, than you should check cross-platform libraries like e.g glib or libapr or other "safe string libraries" like e.g: SafeStrLibrary

提交回复
热议问题