Solved

CString , std::string Size Limitation

Posted on 2007-04-11
4
1,125 Views
Last Modified: 2013-12-14
I'm having trouble with populating CString and std::string with really large strings.  Roughly, after 200 chars, CString and std::string start to poop out and throw exceptions.

How does one deal with large strings...I really need to have a large string with over 500-1000 characters.

I'm really desperate and need to fix this as soon as possible..please help!!

I'm using Visual Studio C++ 6.0 -- I have to use this compiler, there's no choice.
0
Comment
Question by:lcor
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 1

Assisted Solution

by:robear7nt
robear7nt earned 150 total points
ID: 18893527
I have had no problems with large strings using CStrings. Is it throwing OUT_OF_MEMORY exceptions?
Can you please show us a sniplet of your code that is having problems, so we better understand what is happening?
0
 
LVL 16

Assisted Solution

by:AlexNek
AlexNek earned 150 total points
ID: 18894050
I haven't such a problem with CString too. I only want to notice speed problem with 10000 symbols string when you add a symbols dynamically at the string. Then you need to allocate enough space before. It is possible that the problem in an other part of your code.
0
 
LVL 30

Accepted Solution

by:
Axter earned 200 total points
ID: 18894913
Both CString and std::string can handle far more then 200 chars.
More then likely, you're getting some type of heap corruption.

Please post your code.
0
 

Author Comment

by:lcor
ID: 18895316
I can't post the entire code -- propietary stuff...so, let me investigate further the heap issue.  I know at least that CString should be okay and something else is happenning.  Thanks!
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Update (December 2011): Since this article was published, the things have changed for good for Android native developers. The Sequoyah Project (http://www.eclipse.org/sequoyah/) automates most of the tasks discussed in this article. You can even fin…
This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question