I'm not sure why but whenever I have a two loops the size() function always returns 0
example below
line 18 always prints out the correct size.
line 24 always prints out zero.
I could switch to using an array or another container to make the program work correctly, I just don't understand why this code here does not work. (I tried .length() also and it's the same behavior)
What are the contents of "custom_music.txt"?
If there are 13 lines or less in that file, then line 24 prints 0 because you call buffer.clear(); on line 21 and then try to read in another line from the file on line 22, which fails since you've already reached the end of the file.
I was trying to ignore the first few notes i put in the music list that I put at the start of the file. Then the program would read the the song locations I wanted to play. I had only added one song to the file though and since my count was off by one it was ignoring that one extra line and since there were no lines to read, it would be zero.