![]() |
|
#1
|
|||
|
|||
Problem dealocating Memory!Hello, I am making this program for school, and I am stuck ... I think the program is not assigning and dealocating the memory correctly because the program sometimes runs and sometimes crashes... plz take a look and see if you see anything wrong with the code.. thanks!
(I am getting the file's path through user input...) CPP / C++ / C Code:
|
|||
|
#2
|
|||
|
|||
Re: Problem dealocating Memory!The first thing that just jumped out at me is this:
CPP / C++ / C Code:
You need to allocate space for the terminator at the end of the string so you would need tempSize+1 chars to store a string of tempSize characters. NOTE: I did not look at anything else in your code...this is just something I saw at the very beginning. It may or may not solve your problem. |
Recent GIDBlog
Vista ?Widgets? on Windows XP by LocalTech
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| A Complete Guide to SD Memory Cards | haulkook | Computer Hardware Forum | 0 | 01-Jul-2008 23:27 |
| A Few Tips on Buying Good Memory Cards and other Hi-Tech Electronic Accessories | haulkook | Computer Hardware Forum | 0 | 02-Jun-2008 03:53 |
| Hard drive/CPU Diagnoses Issues | binarybug | Computer Hardware Forum | 1 | 22-Jan-2007 19:23 |
| Strange C++ code memory leakage problem | gaoanyu | C++ Forum | 7 | 04-Nov-2005 08:09 |
| [Tutorial] Pointers in C (Part I) | Stack Overflow | C Programming Language | 1 | 08-Apr-2005 18:35 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The