Go Back   CodingForums.com > :: Computing & Sciences > Computer Programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-20-2002, 10:12 AM   PM User | #1
fahad
New to the CF scene

 
Join Date: Oct 2002
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
fahad is an unknown quantity at this point
2_D Arrays

Hello,

My query regards 2 D arrays. As we know a 1 D array ( say int k[7]; ) k points to the zeroth oth or the first element of the array.

When it comes to a 2 D array ( int k[7] [3] )..what is the exact role of k here? Need to complete my university assignment,,,any help would be great..
fahad is offline   Reply With Quote
Old 10-20-2002, 02:33 PM   PM User | #2
Josh Campbell
New Coder

 
Join Date: Jun 2002
Posts: 66
Thanks: 0
Thanked 0 Times in 0 Posts
Josh Campbell is an unknown quantity at this point
If you have a multidimensional array (k) it is actually an array of arrays. (k) points to the address of the first element of the entire array (&k[0]). Since (k[0]) is itself an array, it points to the address of the first element contained inside it (&k[0][0]). Since both point to the same location it can be said that (k) and (k[0]) have the same value.

So k merely points to the first array, inside the array.
Josh Campbell is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:23 PM.


Advertisement
Log in to turn off these ads.