'I have written a Word Descrambling game in C++. Can somebody tell me why my code is not showing any output?

I have written a code for word descrambling game in C++. The code is working perfectly fine. But the code is not showing any output.

Can somebody help me with what to do? I mean just tell me what am I missing to show the output of the code.

#include <bits/stdc++.h>
using namespace std;

string sortString(string word)
{
   transform(word.begin(), word.end(), word.begin(), ::toupper);

   sort(word.begin(), word.end());
   return word;
}
void jumbledString(string jumble)
{
   string checkPerWord = "";
   string userEnteredAfterSorting;

   userEnteredAfterSorting = sortString(jumble);

   ifstream words("words.txt");

   if (words) {
       while (getline(words, checkPerWord)) {

           string Ch = sortString(checkPerWord);

           if (Ch == userEnteredAfterSorting) {
               cout << checkPerWord << endl;
           }
       }
       words.close();
    }
 }

 int main()
{
   string string = "tac";
   jumbledString(string);
   return 0;
}
c++


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source