Ok, I've been struggling a lot with what I think is a minor tweak somewhere.
When using debug mode everything is working as intended with the code that I'm done with but when using release I get error: "Process finished with exit code -1073741819 (0xC0000005)"
This is happening when using switch case 1 and trying to read data from a .txt-file. In debug mode it loads fine but in not when compiling normally.
Assignment is creating a jukebox which you can add albums to.
There is no need for it, the constructor will do it for you.
I can't see any obvious problems in your code. while(inFile >> tmpAlbum) this could be a place where things could go wrong.
Can you show this code?
I think the problem code is elsewhere (in code you haven't posted.)
The vector member will be initialised (by its default constructor) as part of the construction of the Jukebox class. So there's nothing you need the change about that.
0xC0000005 = Access Violation, so somewhere code is trying to access inaccessible memory. Have you got a stack trace for the crash?
The debug build can behave differently for a number of reasons. One of them is that the debug memory allocation routines will fill newly allocated memory with a file pattern, whereas the normal allocation routines don't bother. They will be left with what ever random values were found there. So it's good practice to initialize newly allocated memory/variables.
So, when reading from file it is supposed to read like this:
Album name1
Number of songs in album 1
Title|Artist|Duration
Title|Artist|Duration
Title|Artist|Duration
Album name 2
Number of songs in album 2
Title|Artist|Duration
Title|Artist|Duration
etc etc.
What makes it work in debug mode? It's confusing me
Luck. Plain simple luck. It happens all the time. The code contains a bug, but sometimes if works anyway. Most programs work by accident, not by design.
One problem with memory access problems is that the bug can be in one place while the symptom shows up somewhere completely different. For this reason, you need to post your entire program for us to help.