C++ solution with multiple pointers
p is a vector of pointers with length being combinationLength\neg. when characters=abcde, and combinationLength=3\nthe values in p will change according to the 
p is a vector of pointers with length being combinationLength\neg. when characters=abcde, and combinationLength=3\nthe values in p will change according to the following patterns\n0,1,2\n0,1,3\n0,1,4\n0,2,3\n0,2,4\n0,3,4\n1,2,3\n1,2,4\n1,3,4\n2,3,4\n```\nclass CombinationIterator \n{\n    public:\n    vector<int> p;\n    string c;\n    int f=0;\n    int l,n;\n    CombinationIterator(string characters, int combinationLength) \n    {\n        c=characters;\n        l=characters.length();\n        n=combinationLength;\n        for(int i=0;i<combinationLength;i++) p.push_back(i);\n    }\n    \n    string next() \n    {\n        string result="";\n        if(f==0)\n        {\n            for(int i=0;i<n;i++) result+=c[p[i]];\n            f=1;\n            return result;\n        }\n        for(int i=n-1;i>-1;i--)\n        {\n            if(p[i]!=i+l-n)\n            {\n                p[i]++;\n                for(int j=i+1;j<n;j++) p[j]=p[i]+j-i;\n                break;\n            }\n        }\n        for(int i=0;i<n;i++) result+=c[p[i]];\n        return result;\n    }\n    \n    bool hasNext() \n    {\n        return p[0]!=l-n||f==0;\n    }\n};\n```
[]