Recent content by punx

  1. P

    Comp Sci Trouble Expanding an Array of pointers in C++

    Deleting the temporary array? I am afraid I am at a loss at what to do at this point.
  2. P

    Comp Sci Trouble Expanding an Array of pointers in C++

    #include <iostream> #include <string.h> #include "Sort.h" using namespace std; void main () { char ** pNamesEntered; char * pNameToSearch; int numEntered (0); int index; int CurrSize (20); int compareResult; pNamesEntered = new char * [20]; do { cout <<...
  3. P

    Comp Sci Trouble Expanding an Array of pointers in C++

    Thanks for the help with this program. All of the different parts work now. I have one last issue with it. What is the code to delete the pNamesEntered array? I was trying: delete [] pNamesEntered; but that gives me an error. I tried: delete [] * pNamesEntered; on a...
  4. P

    Comp Sci Trouble Expanding an Array of pointers in C++

    I do know what a data structure is, but that is for next project. This project is supposed to be using pointers for everything. As far as dynamically allocating the array of pointers, that is what I thought I was doing with: CurrSize += arrayExpansion; char ** pNew; pNew = new...
  5. P

    Comp Sci Trouble Expanding an Array of pointers in C++

    I would never do that. Unless they pissed me off. Seriously though, I went through and commented out the sections that were deleting the pNamesEntered elements. Now when I run the program, and enter the 21st element, it crashes and the Just in Time debugger (using Visual Studio 2005)...
  6. P

    Comp Sci Trouble Expanding an Array of pointers in C++

    I thought what I was doing there was to create a new temporary array of pointers, copy the old array to the new array, delete the old array, then assign the new temp array info to a newly established pNamesEntered array. Honestly, I think a lot of my trouble is I am not quite grasping the...
  7. P

    Comp Sci Trouble Expanding an Array of pointers in C++

    Homework Statement I am working on a program that reads in names (strings), sorts them, and then later is searchable. The problem I am having is this. When I enter the first 20 elements of the array, everything works fine. When I enter the 21 element (when it goes into the if loop) I get...
Back
Top