Which string manipulation functions should I use?

后端 未结 6 2199
轮回少年
轮回少年 2021-02-13 00:07

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:34

    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

提交回复
热议问题