I've been writing a fairly simple program for the last week or so, I'm fairly new to C++ but not a complete beginner however I really need help with optimizing it. I've got the program set up to acquire various pieces of information (it's a character generator for D&D and so it needs a good deal of information such as name, class, class features, etc.). I then have it set up to output the information using the cout command. The problem is that before it's meant to output, the program crashes completely. I don't know how to optimize it to prevent this from happening and I'm all out of ideas on alternatives. Any help is much appreciated. Sorry if I come across as being a total idiot, my only experience with C++ is a book and a few online tutorials, I hope to improve soon. The code below is the output function:
It crashes right before the function is supposed to run, so that's good I guess, do you have any idea where the problem could be? The program compiled fine. Is there some kind of function limit I'm not aware of?
I then have it set up to output the information using the cout command.
For your information, std::cout is not a command and it's not a function. It's an output stream. Think of it as a special file mapping to the console.
The problem is that before it's meant to output, the program crashes completely. I don't know how to optimize it to prevent this from happening and I'm all out of ideas on alternatives.
Optimization is the process of improving the performance and efficiency of your program.
C++ compilers (the utilities which translate a .cpp file into an .exe file) are able to do small optimizations automatically but the major optimizations (which have to do with using the appropriate data structure and algorithms) remain the programmer's responsibility.
Long story short, optimization is not about fixing bugs.
@Catfish4 Thank you for clarifying, like I say, I'm pretty new to this and I'm definitely not au fait with the terminology but it's people like you that help me learn! :D
Thank you for the help in this thread, I located the problem based on some advice and fixed it, thank you!