-
November 20th, 2012, 11:19 AM
#1
Storing 2D char array
Hi, I am unable to understand why is the output for this shows me the address of the stored array.
int main()
{
size_t k= 0 ;
char t[3][100] = { "hi", "di", "fi" } ;
char s[3][100] ;
for (int r = 0 ; r < 3 ; r++)
{
size_t k = strlen (t[r]);
for ( int c = 0 ; c < k ; c++)
{
s[r][c] = t[r][c] ;
// cout << s[r][c] ; // this works perfect to show me the output
}
}
cout << s[r][c] ;
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|