Code:
void ooint::intfcat(const char * Int1)
{
char Int2[1024];
strcpy(Int2, Int1);
strrev(CString);
strrev(Int2);
strcat(CString,Int2);
strrev(CString);
}
That gives the same error as
Code:
void ooint::intfcat(const char * Int1)
{
char Int2[1024];
strcpy(Int2, Int1);
strcat(Int2,CString);
strcpy(CString,Int2);
}
[EDIT]I figured out why it has the same error... its overflowing!
If I try to use an "oostring" instead of a string... oostring is a string class:
Code:
void ooint::intfcat(const char * Int1)
{
oostring Int2;
oostring Int3;
Int2 = Int1;
Int3 = CString;
Int2 += Int3;
for (int i=0; Int2[i] != '\0'; i++)
CString[i] = Int2[i];
CString[i] = '\0';
}
Then I get:
Code:
100 1001 index out of range: 5 string: 31001
Assertion failed: 0 <= k && k < strlen(CString), file c:\program files\microsoft
visual studio\myprojects\oostring.cpp, line 103
Please, can someone help me figure out how to get it to resize the object? It works if it is done outside of a class...
I don't want to use a vector unless I have to.