How to Declare Pointer to an Array of Strings in C++? Last Updated : 23 Jul, 2025 Comments Improve Suggest changes Like Article Like Report In C++, an array of a string is used to store multiple strings in contiguous memory locations and is commonly used when working with collections of text data. In this article, we will learn how to declare a pointer to an array of strings in C++. Pointer to Array of String in C++If we are working with C-style strings, we can directly declare the pointer to array of strings as double pointer to and for std::string object we need to declare a pointer of std::string type. Syntax to Declare Pointer to an Array of String in C++char **ptrFor std::string object use the below syntax: string* pointerToArray;C++ Program to Declare a Pointer to an Array of StringsThe following program illustrates how to declare a pointer to an array of strings in C++ C++ // C++ Program to illustrate how to declare pointer to // strings #include <iostream> using namespace std; int main() { // for C-style string const char* arr1[] = { "String1", "String2", "String3", "String4" }; // or // for C++ style stings string arr2[4] = { "Str1", "Str2", "Str3", "Str4" }; // Declare a pointer to an array of strings arr2 string* ptr_to_arr = arr2; // Accessing and printing elements of the array using // the pointer cout << "Array Elements: " << endl; for (int i = 0; i < 4; ++i) { cout << *(ptr_to_arr + i) << " "; } return 0; } OutputArray Elements: Str1 Str2 Str3 Str4 Time Complexity: O(1)Auxiliary Space: O(1) Create Quiz Comment H heysaiyad Follow 0 Improve H heysaiyad Follow 0 Improve Article Tags : C++ Programs C++ cpp-array cpp-pointer cpp-strings CPP Examples +2 More Explore C++ BasicsIntroduction to C++3 min readData Types in C++6 min readVariables in C++4 min readOperators in C++9 min readBasic Input / Output in C++3 min readControl flow statements in Programming15+ min readLoops in C++7 min readFunctions in C++8 min readArrays in C++8 min readCore ConceptsPointers and References in C++5 min readnew and delete Operators in C++ For Dynamic Memory5 min readTemplates in C++8 min readStructures, Unions and Enumerations in C++3 min readException Handling in C++12 min readFile Handling in C++8 min readMultithreading in C++8 min readNamespace in C++5 min readOOP in C++Object Oriented Programming in C++8 min readInheritance in C++6 min readPolymorphism in C++5 min readEncapsulation in C++3 min readAbstraction in C++4 min readStandard Template Library(STL)Standard Template Library (STL) in C++3 min readContainers in C++ STL2 min readIterators in C++ STL10 min readC++ STL Algorithm Library3 min readPractice & ProblemsC++ Interview Questions and Answers1 min readC++ Programming Examples4 min read Like