I'm just trying to fill up a 2d array with the names.
When I run it, it compiles, but doesn't display anything.
So I think the 2d array isn't being filled up.
The correct way to read CSV is actually very, very obnoxiously complicated. But if you can restrict it enough (as you have here) then life gets a whole lot simpler.
Trimming leading and trailing whitespace belongs to a function set variously named “trim” something something... Here is the simplest of the simple version of trim:
Notice how I put the fstream stuff in braces {}.
This makes all the names used there local to those braces, and does nice things like automatically close the file when we’re done with it.