hackingcpp / comments

Comments regarding hackingcpp.com
0 stars 0 forks source link

cpp/recipe/string_parameters #55

Open utterances-bot opened 2 weeks ago

utterances-bot commented 2 weeks ago

Passing Strings To Functions C++ | hacking C++

Which function parameter types should be used for taking strings? Four different scenarios are shwon: 1) read-only access in C++17, 2) read-only access in C++98 to C++14, 3) when a copy of the input string is always needed inside the function, 4) in-place modification of the input string.

https://hackingcpp.com/cpp/recipe/string_parameters.html

jiuyueshenhua commented 2 weeks ago

helpful!