AWS::String str("Hello World!"); const char* cstr = str.c_str(); std::cout << cstr << std::endl;
AWS::String str("Amazon Web Services"); size_t length = str.length(); const char* cstr = str.c_str(); for (int i = 0; i < length; i++) { std::cout << cstr[i] << " "; } std::cout << std::endl;In this example, we create an AWS String object and use c_str() to get a pointer to the character array. We then loop through the array and print out each character followed by a space. The AWS String class is part of the AWS SDK for C++.