a.dll
void a(std::string& str){
str="123;
}
test.exe
int main(){
std::string str;
a(str);
}
- If a.dll and test.exe is Static CRT linked, and assume that std::string handle a char* point cstr to the buffer.Since the two modules compile std::string separately. Is it right that a.dll uses its own crt to alloc memory for cstr . Then test.exe uses its own crt to free memory for cstr.
- If 1 is true. Can it guarantee that it is correct when a.dll and test.exe linked with same version of crt.
want to solve the doubt
New contributor
Savion Wan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.