![]() |
|
|||||||
|
|
Thread Tools | Search this Thread | Rate Thread |
|
#1
|
|||
|
|||
variables return to previous value after i try to set themthanks for all the help you guys have givin me already, i am new to windows programming so please bear with my millions of posts...
i have defined a struct that is just a bunch of basic strings and i dynamically created an array of this struct. i am trying to allow the user to delete any one of the array locations (sorry i'm not as good as i should be at talking in c++) , anyway, i am doing this by just bumping up the values of each location starting with the one after the one to be deleted. this is where the problem is: for some reason when i change one of the variables, it immediatly resets itself to its original value. i am doing this all within a member function of the dialog where the info is displayed. here is the function: CPP / C++ / C Code:
i have all those message boxes to show me what the value is at different points. This seems simple enough to me but i'm new to dynamic memory allocation so i might be missing something that has to do with that, but i really don't know. the Rfile function simply creates the variables and reads the stuff from the file into the variables and then puts the information into the list control. the Wfile function just writes the info to a file and deletes the variables. (i put these two functions that so that the list control that i'm using to display the information would be updated). please help if you have any ideas as to what could possibly cause variables to reset themselves to their original values when you try to change them, this makes no sense. |
|
#2
|
|||
|
|||
|
If I am not wrong, you use a simple c-typed array for your "array".
Well, to avoid a lot of errors in the near future, from personal experience, use CArray - easy to create and maintain. |
|
#3
|
|||
|
|||
hmmmwell i'm not exactly sure what that is so i'll just post the declaration , it is just a simple struct:
CPP / C++ / C Code:
i just don't understand why the variables reset themselves. besides i didn't even get any errors |
Recent GIDBlog
Meeting the populace by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Re: Things to Avoid in C/C++ -- gets() , Part 1 | WaltP | C Programming Language | 5 | 21-Jun-2007 12:13 |
| Problem with one variable | bretter | C++ Forum | 1 | 16-May-2005 07:20 |
| [Tutorial] Pointers in C (Part I) | Stack Overflow | C Programming Language | 1 | 08-Apr-2005 18:35 |
| C++ file I/O | CronoX | C++ Forum | 36 | 09-Mar-2004 17:28 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The