Hi.
Does anyone know the size limit of a CString variable in kb's?
Thanks in advance. :cool:
Printable View
Hi.
Does anyone know the size limit of a CString variable in kb's?
Thanks in advance. :cool:
I don't know, but I think they either use a 32 bit size variable, or a 0-terminated string. In both cases there is basicly nothing to worry about.
If you need to put in more data than a CString is capable
of, then you should rethink your design.
Try splitting up the data.
That's what I have been trying to find out. How much data a CString can hold. :D I'm still waiting on a definitive answer, by the way ...Quote:
Originally posted by noble
If you need to put in more data than a CString is capable
of...
Probably about 2 gig ;) (the limit for a program)
Although in practice you're most likely to be limited to about 400/500mb...why do you need THAT much data that you need it all in a continuous pointer (i.e. a CString)?
You need some kind of "chunked" storage, like a deque (STL) or one of the rope classes.
A locally declare CString is limited to less than 1 MB (max stack size - mem needed by all function calls, which is about 1kB in a high-level MFC call).
Nope, the strings are always allocated on the heap :)Quote:
Originally posted by CornedBee
A locally declare CString is limited to less than 1 MB (max stack size - mem needed by all function calls, which is about 1kB in a high-level MFC call).
uh, right parksie, forgot that.
Thanks for the information. I appreciate it.