Regarding your code, one of the worst issues is that you don't understand the concepts of arrays and pointers very well: you repeatedly allocate arrays of pointers, when actually you intended (probably) to allocate arrays of char instead!
Of course, there are multiple problems with this, and the least of it is that your code does very silly things:
1. you're using arrays and allocations and pointers without understanding these concepts very well
2. You're using a tutorial that apparently suggests doing these things, although you shouldn't do any of that, because C++ offers much cleaner, better and easier ways!
3. You keep shooting questions about code that doesn't make sense at all, not even for a tutorial! It's so painful that the only meaningful advice to give is don't do that!
For these reasons, this is my actual advice:
This code is very bad and outdated. You can learn nothing from that than bad programming. If that is from a tutorial, stop right there and find an up-to-date C++ tutorial that does not use old C-style headers and char arrays! That way lies only pain! C++ is already a difficult language to learn, there is no reason to make it even harder!
For a start, you can go here:
C++ Language - C++ Tutorials[
^]
If you find other sources, watch out for these signs of bad and outdated material:
1. including system headers that end in .h : these are old C headers that still exist for backward compatibility, but these shouldn't be used any more! There is a lot of code on the web that still uses them, mainly because they were copied and pasted dozens of times, from original code that dates back to the last millenium! Both the style being used back then and the functions contained within do no longer conform with modern standards!
2. Do not use #define! The problem with #define is that it's incredibly easy to break not only your functions but many other functions too, in many unexpected ways. It takes a very high level of understanding to use #define responsibly, and with minimal risk. It takes an even higher level of understanding to fix bugs caused by bad uses of #define!
3. Do not use pointers, and be wary of tutorials that use them: raw pointers are a dangerous trap. They are the most common root for program exceptions and crashes. C++ offers smart pointers such as std::shared_ptr and std::unique_ptr which are safe to use unless you start being creative in an unhealthy manner. See
<memory> - C++ Reference[
^]
4. Do not use standard C-style arrays. While you're learning, std::vector should fulfil all of your needs in most cases. Here is a list of C++ containers for different purposes:
Containers - C++ Reference[
^]