Changes

Jump to: navigation, search

Console UI Core Classes - OOP344 20113

583 bytes added, 06:31, 21 March 2012
CText Tester Crash
===The Text Helper Class===
[svn://zenit.senecac.on.ca/oop344/trunk/textClass Text class]
<!-- ===CText Tester Crash=== Incorrect, TD[0].data() allocates mem and copies the data into it using text::export string
<syntaxhighlight lang="cpp">
char* data = (char*)TD[0].data();
delete [] data;
</syntaxhighlight>
This fails because TD[0].data() refers to CField::data() and NOT CText::data() like it should.
Here are some possible fixes that I think Fardad meant to use:
<syntaxhighlight lang="cpp">
char* data = (char*)((CText&)(TD[0])).data();
OR
char* data = (char*)txt.data();
</syntaxhighlight>
Note, this does NOT crash on Matrix, only Windows and Visual Studio.
-->
==CCheckList==

Navigation menu