U
Urban Andersson
In all recomendations from Microsoft you read that you should use
StringBuilder instead of String when passing an In/Out parameter to a
external function. What is the benefits using the StringBuilder instead of
string. Both need to have the capacity to hold the string recieved the only
difference is that you recieve an exception when the buffer is to small in a
stringbuilder. When using the string you will not recieve an exception but
the unmaged code will overwrite the buffer if it is not of suffient size. Is
there any other difference between the two?
StringBuilder instead of String when passing an In/Out parameter to a
external function. What is the benefits using the StringBuilder instead of
string. Both need to have the capacity to hold the string recieved the only
difference is that you recieve an exception when the buffer is to small in a
stringbuilder. When using the string you will not recieve an exception but
the unmaged code will overwrite the buffer if it is not of suffient size. Is
there any other difference between the two?