Answer the question
In order to leave comments, you need to log in
Char array or string as DLL function argument?
Hello. I am writing a dll to work with a device via a COM port.
Some functions take strings as arguments. The library can connect both to its own programs and to other environments, such as LabVIEW.
Tell me, how best to make them (function arguments) as a char array or as a string? and what are the pros and cons? You can refer to literature. Thanks
Answer the question
In order to leave comments, you need to log in
Better char*, because Firstly, this is more universal (you can connect your lib to any language that can use C-libs), and secondly, as mentioned above, the implementation of std::string differs for different compilers.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question