08-04-2006, 06:33 PM
Using lpstr for function arguments is better than str because:
1. Better performance. str would allocate and copy string.
2. Error when accidentally trying to pass a number.
Use str if:
1. Performance is not important, or the string would be copied to str variable inside the function anyway.
2. To be able to pass strings and numbers. When you assign a number to a str variable, it is automatically converted to string.
1. Better performance. str would allocate and copy string.
2. Error when accidentally trying to pass a number.
Use str if:
1. Performance is not important, or the string would be copied to str variable inside the function anyway.
2. To be able to pass strings and numbers. When you assign a number to a str variable, it is automatically converted to string.
