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

R mutate multiple columns with ifelse

1  Asked on December 7, 2021 by qnp1521

   

How can I show the code of my program in the output in python?

2  Asked on December 7, 2021 by ayaan-singh-saundh

   

Can’t unzip file with php

3  Asked on December 7, 2021 by ciro-garca

     

why isn’t my local variable overwriting the global?

4  Asked on December 7, 2021 by pillow-study

   

Variable not assigned even though I assigned it (Android Java)

1  Asked on December 7, 2021 by ictwinner

   

Function to find string with only one emoji

1  Asked on December 7, 2021 by user1199595

 

How to group buttons on Google Closure editor?

1  Asked on December 7, 2021 by frenchcooc

 

Mark non db fields @Transient vs extent JPA Entity?

1  Asked on December 7, 2021 by bluelurker

       

Ask a Question

Get help from others!

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