While I'd start by suggesting that you use the .NET file stream options instead, String^ can be converted to std::string using marshal_as if so needed.
deceptikon 1,790 Code Sniper Team Colleague Featured Poster
Nether_1 commented: This worked, I posted the new code. BTW, I know you can use .NET file stream, but since I'm more acquainted with the fstream system, I used it. +1
deceptikon 1,790 Code Sniper Team Colleague Featured Poster
Gribouillis commented: Many great suggestions in this answer! +14
deceptikon 1,790 Code Sniper Team Colleague Featured Poster
ddanbe commented: Good point. +15
deceptikon 1,790 Code Sniper Team Colleague Featured Poster
AssertNull commented: Good explanation +6
nitin1 commented: Awesome :) +4
deceptikon 1,790 Code Sniper Team Colleague Featured Poster
ddanbe commented: Great answer. +15
deceptikon 1,790 Code Sniper Team Colleague Featured Poster
nitin1 commented: +1 +0
deceptikon 1,790 Code Sniper Team Colleague Featured Poster
nitin1 commented: +1 for to-the-point answer +4
deceptikon 1,790 Code Sniper Team Colleague Featured Poster
deceptikon 1,790 Code Sniper Team Colleague Featured Poster
ddanbe commented: kudos! +15
AssertNull commented: I like this approach. +5
deceptikon 1,790 Code Sniper Team Colleague Featured Poster
deceptikon 1,790 Code Sniper Team Colleague Featured Poster
deceptikon 1,790 Code Sniper Team Colleague Featured Poster
diafol commented: I suggested this a long while back. Too painful +0
deceptikon 1,790 Code Sniper Team Colleague Featured Poster
deceptikon 1,790 Code Sniper Team Colleague Featured Poster
deceptikon 1,790 Code Sniper Team Colleague Featured Poster
deceptikon 1,790 Code Sniper Team Colleague Featured Poster
rubberman commented: Good explanation. +13
deceptikon 1,790 Code Sniper Team Colleague Featured Poster
deceptikon 1,790 Code Sniper Team Colleague Featured Poster
Blake_2 commented: How do I edit my post on here? I see a major typo and I want to include the calloc thing you mentioned; I wasn't aware of that! +0
deceptikon 1,790 Code Sniper Team Colleague Featured Poster
rubberman commented: IE, the stack overflows! +13
deceptikon 1,790 Code Sniper Team Colleague Featured Poster
overwraith commented: Good observations. +2
deceptikon 1,790 Code Sniper Team Colleague Featured Poster
deceptikon 1,790 Code Sniper Team Colleague Featured Poster
Santanu.Das commented: perfect suggestion +5
deceptikon 1,790 Code Sniper Team Colleague Featured Poster
deceptikon 1,790 Code Sniper Team Colleague Featured Poster
deceptikon 1,790 Code Sniper Team Colleague Featured Poster
ddanbe commented: Your indeed worth, to be called a "Code Sniper" +15