c++ - Array of char or std::string for a public library? -


My question is simple: should I use an array of four eg:

  Four * buffs, buf2 [MAX_STRING_LENGTH]  

etc. or I should use std :: string in a library which will be used by other programmers, where they make it any SO and their compiler Can use as election?

Considering the performance and portability ...

From my point of view, the STD string is easy and the display is equal or STD: the difference is not very easy to use I do not know the portability I know that it is standard, should not be a compiler that compiles C ++ without it, at least any important compiler Edit

>

client Depending on how this library will be used in conjunction with code. If it is dynamically linked and you have a set of APIs for the client - then you are better using the taped byte string (i.e. char * ) and their wide-character counterparts . If you are talking about using them within your code, then you are definitely free to use std :: string if it is being included as a source - std :: string works fine.


Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

php - jQuery AJAX Post not working -