AnswerBun.com

What does "Cch" mean in StringCchPrint*?

Stack Overflow Asked by Ari Sweedler on January 1, 2022

fprintf means "[f]ile [print] [f]ormatted".

For the StringCchPrint* family (https://docs.microsoft.com/en-us/windows/win32/api/strsafe/nf-strsafe-stringcchprintfa), I can’t find anything mentioning [Cch].

I know that the A suffix denotes char, the f suffix denotes TCHAR (text char? which appears to be what they want the deafult data type to be for this type of stuff?) and W denotes WCHAR (wide char?)

I have no experience with windows naming conventions, this is confusing.

One Answer

The (lowercase) "ch" part of the names refers to the fact that these functions take a count of characters as their relevant argument(s), as opposed to the related functions with a "b" in their names (such as StringCbPrintf), which take a count of bytes. (These counts are different when using UNICODE builds, where the strings are formed of 2-byte wchar_t elements.)

Further, as pointed out by dxiv, the uppercase "C" stands for "count" - which is similar to the Microsoft naming convention for structure members that are 'counts', such as .cbSize or .cchLength.

Answered by Adrian Mole on January 1, 2022

Add your own answers!

Related Questions

NodeJS – Custom DNS lookup, fallback to ipv4

0  Asked on February 25, 2021 by giyona43

 

Validate input of jTextField using setter java

1  Asked on February 25, 2021 by random

     

How to make both bits of code run at the same time

1  Asked on February 25, 2021 by atay-hassan

     

SSL for pointed domains

1  Asked on February 24, 2021 by userhex

         

Encrypt message using RSA on ESP32

0  Asked on February 24, 2021 by daniel-tang

       

Counting the occurrences of a substring in a string python

2  Asked on February 24, 2021 by indrajith-ekanayake

       

C# calculations differ between const and variable locals?

1  Asked on February 24, 2021 by ren-van-den-berg

       

How do i call API with multiple parameters in android studio

3  Asked on February 23, 2021 by shane

       

Ask a Question

Get help from others!

© 2023 AnswerBun.com. All rights reserved. Sites we Love: PCI Database, MenuIva, UKBizDB, Menu Kuliner, Sharing RPP, SolveDir