Limit on size of a CString?
-
Does anyone know what the limit for the length of a single CString is? I thought it was 255 characters, but I can't find any documentation on it. Any references to documentation on this would be appreciated as well. I'm using MFC 6.0. Thanks, Jason :confused:
-
Does anyone know what the limit for the length of a single CString is? I thought it was 255 characters, but I can't find any documentation on it. Any references to documentation on this would be appreciated as well. I'm using MFC 6.0. Thanks, Jason :confused:
No, it's not 255 characters. There are limits on the length of strings in resources and other places, but the only limit is the length of the CString length variable, which is a signed int. Thus, assuming you have enough virutal memory space, you can create strings up to 2GB.
-
Does anyone know what the limit for the length of a single CString is? I thought it was 255 characters, but I can't find any documentation on it. Any references to documentation on this would be appreciated as well. I'm using MFC 6.0. Thanks, Jason :confused:
From the topic 'Strings in MFC' (from VC5.0 documentation, YMMV): "A CString object can store up to INT_MAX (2,147,483,647) characters. "