how to do this recursive program?

hi

1
2
3
4
5
6
7
8
9
10
11
12
13
14


int main(int argc, char *argv[]) 
{
    cout << "Enter a string: ";
    string input;
    getline(cin, input);

    vector<string> v = generate_subsets(input);
    for (int i = 0; i < v.size(); i++)
    cout << v[i] << endl;

    return 0;
}

Last edited on
Care to be more specific about what the problem is?
i am getting error on the line 49 and cannot output the final result.
And the error is?
errors are
1
2
3
4
5
In function `std::vector<std::string, std::allocator<std::string> > generate_subsets(std::string)': 

invalid conversion from `const char' to `const char*' 

initializing argument 1 of `std::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, const _Alloc&) [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>]' 


and also i don't understand exactly what to write in main fuction.
Topic archived. No new replies allowed.