I was wondering if there is any advantage (for shorter strings only) of using a string datatype instead of a char array, or simply the string such as:
TextOut(hDC, 10, 10, "Hello", sizeof("HEllO") - 1)
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In practice, this doesn’t matter at all.
That said, the Win32 APIs require
LPSTRs orLPWSTRs, so anything which is not “one of those” will first have to be converted into the appropriatechar*type, so a very tiny bit of extra work is required.I’d say the vastly bigger consideration is using a datatype which is convenient/familiar/easy for you to work with.