I would like to use the following static function. This function will in turn compute the input, and std::cout a result. After the static function is called and taken off of the stack, will all of this memory associated with this class be freed? Is this equivalent to making an instance of this class within the scope of main, or would it only exist for the duration of this function call? Assume that the function is called as it is below in the main function. Also, further reading links would be great.
typedef std::vector< std::vector<int> > matrix;
class LCS
{
public:
static void getLCS(std::string,std::string);
private:
void compute_alignment();
std::vector<std::string> f1,f2;
matrix cost,link;
};
int main(int argc, char* argv[])
{
//check command line args
if(argc != 3){std::cout<<"usage: ./exe file1.txt file2.txt";exit(1);}
//compute
LCS::getLCS(argv[1],argv[2]);
}