I'm wondering how a string variable "x" can be printed out by just typing "x", without any parentheses in the end. I understand that int and char etc. can be printed out that way, but string is a class type containing an array of chars, and is thus not a fundamental data type in C++.
I assume you're taking about using the << operator to output to a stream, yes?
It's possible, because you can overload the << operator for any type. The standard library includes such an overloaded operator for the std::string class, but you can write one for any class.