Is it safe to return a struct in C or C++?

后端 未结 12 1882
北海茫月
北海茫月 2020-12-04 07:55

What I understand is that this shouldn\'t be done, but I believe I\'ve seen examples that do something like this (note code is not necessarily syntactically correct but the

12条回答
  •  时光取名叫无心
    2020-12-04 08:46

    It's perfectly legal, but with large structs there are two factors that need to be taken into consideration: speed and stack size.

提交回复
热议问题