1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

array of strings input problem

Discussion in 'Meet and Greet' started by rdx, Jul 7, 2012.

  1. rdx

    rdx New Member

    Joined:
    Jul 7, 2012
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Code:
    #include<iostream>
    #include<string>
    #include<conio.h>
    using namespace std;
    int main(){
    	string array[5][5];
    	int i=0,j=0;
    	string z[5]={"abdg","ygur","guqh","asdf","sent"};;
    	for(i=0;i<5;i++)
    	     for(j=0;j<4;j++)
    	      { array[i][j]=z[i][j];
    	       cout<<"\narr[][]="<<array[i][j];}
    	 for(i=0;i<5;i++)
    	 cout<<"\narr="<<array[i]<<endl;		//this z not workin. THERE IS NO ANY O/P. PLZZ HELP ME TO RESOLVE THIS PROBLEM!			
    						 
      getch();
      return 0;
    	
    	}					 
    
     

Share This Page