In C# the as keyword converts a value to another type. There is code that supports this conversion (probably in the C# runtime). This is not a cast.
For the most part you can't use dynamic_cast or any other kind of cast in C++ to accomplish this, because casts and conversions are not the same thing. I say 'for the most part' because some types can be converted using static_cast, to convert an int to a float but this is still a conversion, not a cast. Also, if you have introduced a type system where everything is derived from an Object-like base class that has this conversion functionality, you might be able to construct a mechanism to support this conversion using dynamic_cast, but you would have had to write this mechanism and this does not seem to be what you're trying to do.
There is nothing built-in to C++ which will do this conversion for you; in other words, there is no C++ equivalent to the C# as keyword.
If you want to perform this conversion, you can often use streams:
#include <sstream>
#include <string>
#include <iostream>
using namespace std;
int main()
{
float f = 42.0f;
stringstream ss;
ss << f;
string s = ss.str();
cout << "Float: " << f << ", String '" << s << "'";
return 0;
}
<sstream> is part of the C++ Standard, so in this regard you might consider it to be 'in the language'.
Using streams to do this conversion can be rather clumsy. Boost offers lexical_cast which can be used to perform these simple conversions with less code:
#include <sstream>
#include <iostream>
#include <boost\lexical_cast.hpp>
using namespace std;
int main()
{
string s = "42";
float f = boost::lexical_cast<float>(s);
cout << "Float: " << f << ", String '" << s << "'";
return 0;
}