Beginner question: string("Chimera")
Hello all,
I am just starting out on C++ having spent some time learning C.
I have come across the following declarations in Chapter 6 of Lippman (3rd edition):
Code:
extern int get_word_count(string file_name);
vector<string> svec(get_word_count(string("Chimera")));
I am rather puzzled by the expression string("Chimera").
Is this casting a string literal into a string type or something? I haven't been able to find any reference to such expressions anywhere. The closest I have found is declarations of the type string string_name("Chimera"), but in the example above there is no identifier.
Also, what value would in such an expression - or the parameter string file_name - have (in C it would be a pointer to char; is it the same in C++, or is the value of an object simply the object itself?)?
Many thanks for any help.