Given a vector of strings, print all anagrams together

Here, is the code which checks whether two strings are anagrams or not, but i have to print all anagrams of a string that exist in array together.