#include #include using namespace std; // implicit and partial initialization //myArrayPartialImplicit2.cpp //---------------- // implict often shows unpredictable results with // data type like string due to address mishandling // ----------- // int main() { //declaring an array, arrays are indexed int index, arraysize; string str1[4] = {"A", "B", "C","D"}; string str2[4] = {"E", "F", "G","H"}; int n1[] = { 1,2,3,4} ; cout<< "string explicit array \n"; //this will compile but will have runtime error // --for(int i=0; i< 6 ; i++) // this will run for(int i=0; i< 4 ; i++) { cout <<" "<< str1[i]; } arraysize = sizeof str2; cout<<"\n size of str2 " << arraysize << endl; //it will allow only total of idexes //that is 0 to 7 for(int j=0; j< 7; j++) { cout <<" "<< str2[j]; } there: cout<<"\n enter a number from 0 to 3 \n \t\b" ; cin>>index; if(index == 9) { exit(1);} else { cout<<"\n str2["<< index <<"] is "<< str2[index]<