Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
Unknown Quality Score

No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.

0 Endorsements
Ranked #4K
~14.1K People Reached
Favorite Forums
Favorite Tags
c++ x 6

5 Posted Topics

Member Avatar for Narue
Member Avatar for faust_g

Dreading memory leaks, I would like to make sure I have an understanding of the following code: [code=CPP] //vector initialized to allocate 10 string objects vector<string> *pvec1 = new vector<string>(10); delete pvec1; //10 vector<string> objects vector<string> *pvec2 = new vector<string>[10]; pvec2[0].push_back("test1"); delete [] pvec2; [/code] 1> Would executing the preceding …

Member Avatar for Radical Edward
0
146
Member Avatar for Gagless

Looking at your code, it looks like your intention is to simultaneously return a pointer to the "copied" array [B]and[/B] clean up the memory allocated by the old array. Having a function perform that task for you can be troublesome because your code doesn't know whether the old array is …

Member Avatar for faust_g
0
134
Member Avatar for Jennifer84

Well, for simplicity, we could repeatedly "trim" the string based on its delimiter. [code=CPP] string rTrimString(string thisString, int occurrence, string delimiter) { for(int i = occurrence - 1; i >= 0; --i) thisString = thisString.substr(0, thisString.rfind(delimiter)); return thisString; } [/code] so, for example, [code] string test = "1,2,3,4,5,6,7,8,9"; cout << …

Member Avatar for Jennifer84
0
319
Member Avatar for faust_g

The following code works fine with "Release" config, but gets this odd "HEAP_CORRUPTION_DETECTED" error when I try to execute in the "Debug" config. I am using visual studio 2005, default settings. Also, I looked into deleting multi-dimensional objects, and it appears I am doing it correctly here ([url]http://www.daniweb.com/forums/thread6511.html)[/url]. Pretty simple …

Member Avatar for faust_g
0
351

The End.