I am trying to pull from my .bashrc an environment variable CUSTPATH. I want to store the various directories in this variable in a vector and then return a pointer to said vector. Here is my code.
The error is just what the warning says. You're returning a pointer to a local vector, which is destroyed when the function exits. Return by value instead.