Return dynamically allocated memory from C++ to C

前端 未结 10 2095
粉色の甜心
粉色の甜心 2021-01-01 07:10

I have a dll that must be useable from C etc, so I cant use string objects etc as a normal would, but I\'m not sure on how to do this safely..

const char *Ge         


        
10条回答
  •  有刺的猬
    2021-01-01 07:48

    If you declare ss as static you can avoid the problem. This could be a good solution if your program runs on a single-thread enviroment.

提交回复
热议问题