/* This program demonstrates * 1. Arrays fo C++ string objects * 2. c++ string object functions * 3. Introduction to pointers * * We can declare arrays of C++ string objects. While their memory storage is quite * different from other conventional arrays. the rest of the array principles still * apply. * Their capacity is determined at compile time, they can be initialized with set * notation, we can iterate through them and use each "element" as ca complete C++ * string object. When passed into a function, an individual C++ string object would * pass by value, but an array of C++ string objects would pass by address * * Pointers are variables that can hold the address of another variable. */ #include #include #include using namespace std; int main() { /* An array os C++ string objects */ string stArray[10] = {"Spongebob", "Squidward"}; /* In the C++ string object array, each "Element" is a C++ string object * which is internally a c-string. So, we can use the second, non-obvious, dimension * to access individual characters. */ cout<<"Access individual characters, stArray[0][4]: "<< stArray[0][4]<