Why am I getting a segmentation when declaring two constructors with different parameters, but the same string of arguments? If I were to declare only one constructor the program will be delightful to compile and execute my results, however declaring more then one constructor a segmentation fault occurs. I deleted the pointer string variables in the destructor. I understand only one destructor is allowed per class with no arguments thus a void keyword inside as well.
You are overusing pointers and dynamic memory, and therefore asking for trouble. Which you get.
In C++ there is a rule named "Rule of three": if you write a custom destructor, then you also need to write a custom copy constructor and copy assignment operator=.
As it is now, you wrote "regular" constructors and the destructor, but the copy constructor and copy assignment operator= are generated automatically... and they do a shallow copy instead of a deep copy. This will bite you in a little bit.
The immediate problem is caused by your constructors. You forget to allocate memory in two of them. It's not enough that you do allocate memory in the first one.
Ha, now I see why! I will keep that Rule of 3 in mind, the whole time I was trying to do different memory allocations in the three constructors in a different way. Instead of allocating all three in each constructor I would just allocate 2 in the constructor that took two arguments and one allocation in the constructor that took 1 argument. I am doing c++ on my android phone so pardon my miss spellings, kinda rough just coding on tiny keyboard touch screen. TY catfish666
Whats an S&M? it can get annoying programming on an android, I am going to have to buy a little keyboard for the phone. But as long as I can do c++ it will be worth it. While I am at work, in thw bathroom, waiting for someone, or before going to bed, I will acknowledge a lot.
I was poking fun at how you make things harder for yourself by using a smart phone.
You should consider using a regular computer for programming.
Nowadays, many people use a desktop PC with dual display: on one monitor they edit the code, and on the other they browse the documentation... while you do it all on a little phone... I hope the little keyboard will help you.
Oh I see, but I actually do all my programming on a computer, well actually on a laptop, but I only program on my mobile android if I am not near my laptop. Its cool because its more universal. If I cannot finish a project when developing an android app on my laptop because I have to go somewhere, I would just do it on my phone, etc. lol I can bring my laptop, but it is an expensive equipment (alienware), and where I am from you would definitely get robbed in a heart beat. Newark, NJ sucks.