Hey all, I'm having trouble with an assignment for my C++ class.

The .pdf has the assignment parameters, and the .cpp file has what I've written so far.

Right now I've written the program enough to make sure the two strings (LastName and FirstName) get swapped correctly and put into the main string (FullName). Then I'm trying to test and make sure I can output them based on the subscript, but every time I run the program it shuts down.

I'm just wondering what I need to do.

I can't do:

const int contacts = numOfContacts;

.
.
.
FullName = new string[numOfContacts]

Because that just creates errors and such.

I think I need something related to that to predefine the number of elements.

Any help with this would be wonderful. :)

I swear the answer is right under my nose, and when I find out what I'm doing wrong, I'm going to feel like a dork. :P

You've declared FullName twice.
Get rid of the first one, and make the second string* FullName = new string[numOfContacts]; Then do something about PhoneNum not being an array of strings as well.

Got rid of the first one and declared the second like you said.

Now when I enter more than one contact and have my test cout run, the program shuts down with the "homework8.exe has stopped working. Windows is searching for a solution to the problem"

It's done this every time I've had the program building with no errors. Does it have to do with how I'm making the array for the fullnames?

Post your updated code...

Don't forget to use [b][[b]code][/code[/b]][/b] tags