<<< Arrays of pointers | Index | Command-line arguments >>> |
#include <iostream> using namespace std; int main( ) { char* months[] = { "Illegal", "Jan", "Feb", "Mar" }; // Each array element keeps address of a character string: cout << months[ 0 ] << '\n'; cout << months[ 1 ] << '\n'; cout << months[ 2 ] << '\n'; cout << months[ 3 ] << '\n'; return 0; } /* Program output: Illegal Jan Feb Mar */
<<< Arrays of pointers | Index | Command-line arguments >>> |