The question sounds a bit odd, but check the code sample
#include <iostream>
using namespace std;
int main() {
string a, b(), c("test");
// No problems
a = c;
// tester.cpp:9:7: error: assignment of function ‘std::string b()’
b = c;
// tester.cpp:10:7: error: invalid conversion from ‘std::string (*)() {aka std::basic_string<char> (*)()}’ to ‘char’
a = b;
// No problems
c = a;
}
You can see that it looks like b is created with the default constructor, but in fact it is not. So my question is really is, what does string b()
mean?