IndiaBIX.com
Arithmetic Aptitude Data Interpretation
Logical Reasoning Verbal Reasoning Non Verbal Reasoning
General Knowledge
Sudoku Number puzzles Missing letters puzzles Logical puzzles Playing cards puzzles Clock puzzles
C Programming C# Programming Java Programming
Networking Database Questions Computer Science Basic Electronics Digital Electronics Electronic Devices Circuit Simulation Electrical Enigneering Engineering Mechanics Technical Drawing
Placement Papers Group Disucssion HR Interview Technical Interview Body Language
Aptitude Test Verbal Ability Test Verbal Reasoning Test Logical Reasoning Test C Programming Test Java Programming Test Data Interpretation Test General Knowledge Test
Data Structures Operating Systems Networking DATABASE Database Basics SQL Server Basics SQL Server Advanced SQL Server 2008 JAVA Core Java Java Basics Advanced Java UNIX Unix File Management Unix Memory Management Unix Process Managemnt C Interview Questions The C Language Basics .NET Interview Questions .NET Framework ADO.NET ASP.NET Software Testing

C Programming - Pointers - Discussion

@ : Home > C Programming > Pointers > General Questions - Discussion

6. 

What would be the equivalent pointer expression for referring the array element a[i][j][k][l]

[A]. ((((a+i)+j)+k)+l)[B]. *(*(*(*(a+i)+j)+k)+l)
[C]. (((a+i)+j)+k+l)[D]. ((a+i)+j+k+l)

Answer: Option D

Explanation:

No answer description available for this question.


Tj015 said: (Wed, Jul 7, 2010 08:42:54 AM)    
 
Can anyone explain this concept?

Vinoth Kannan said: (Mon, Jul 19, 2010 01:00:25 PM)    
 
This is an another way for writing pointer variable

Ramanaji said: (Fri, Aug 13, 2010 09:07:20 AM)    
 
If we want to refer one dimensional we just use single pointer ie like *p, if we need to refer two dimensional we have to use double pointer reference ie *(*p),,if we have to refer 4 at a time just use 4 pointer statement i.e. *(*(*(*(p))))and so on.....

Vani said: (Mon, Aug 23, 2010 02:07:50 AM)    
 
Thank you Ramanji.

Pradeep said: (Wed, Aug 25, 2010 01:57:34 PM)    
 
ptr[0]------>*(ptr+0);
ptr[1]------>*(ptr+1);

Like that:

a[i]---->*(a+i);
a[i][j]---->*(*(a+i)+j);
a[i][j][k]---->*(*(*(a+i)+j)+k);

Now you can understand.

Sakthi said: (Thu, Aug 26, 2010 06:02:44 AM)    
 
Nice explanation from Ramanji & Pradeep.

Swati Bhatt said: (Tue, Sep 7, 2010 11:11:58 AM)    
 
Thanks to both of you for your good explation, even I know this ans but not clearly.

Harsha said: (Thu, Sep 23, 2010 09:04:12 PM)    
 
Actually in array concept pointer with create automatically know? Then why should we represent them symbolically? According to this option A is also right na.

Guru said: (Thu, Oct 21, 2010 07:25:36 AM)    
 
Thank you raman and pradeep.

Its nice explanation.

Srivibha said: (Sun, Oct 31, 2010 04:25:20 PM)    
 
Why we are getting same value when we are printing *(a) and *(*(a))?

Gautam Jangra said: (Fri, Nov 26, 2010 03:19:59 AM)    
 
i am agree with pardeep great answer

Deep said: (Tue, Dec 7, 2010 10:22:35 AM)    
 
Good pradeep.

Riya said: (Wed, Dec 29, 2010 12:42:00 AM)    
 
Thank you Pradeep.

Thangavel.V said: (Wed, Dec 29, 2010 01:17:46 PM)    
 
Nice Explanation pradeep..lot of thanks ...

Maahi said: (Sun, Jan 9, 2011 11:25:27 AM)    
 
Nice explanation!

Neeti said: (Tue, Jan 25, 2011 05:36:07 AM)    
 
I also agree with Ramanaji.

Suma Sahithi said: (Mon, Jan 31, 2011 10:37:33 PM)    
 
Array itself is a pointer. If we creat an array it defaultly takes address of 1st element, so to take value in that address we should place * before it. As it is a 4 dimentional array we should place * before each one.

Thangarasu said: (Thu, Feb 3, 2011 01:38:40 AM)    
 
Nice explanation by pradeep and ramanaji !.

Bhava said: (Fri, Feb 25, 2011 07:17:28 AM)    
 
Since the array element is asked we have to use * operations and 4 times * is because of 4 dimensional array.

Emel said: (Wed, Mar 9, 2011 10:38:16 AM)    
 
Nice explanation guys!

Hiren Savalia said: (Sun, May 8, 2011 03:58:58 PM)    
 
Smart 1 ...
in answer we are looking for equivalent POINTER ... and in answer there is only 1 option which has POINTER symbol that is * so select it as answer .... :)

Naveen said: (Thu, May 19, 2011 06:18:46 AM)    
 
Thanks to all.

Anil Kumar Kandula said: (Sat, Jul 2, 2011 11:13:11 PM)    
 
a[i] = *(a+i)

a[i][j] = *(a[i]+j)
= *(*(a+i)+j)

a[i][j][k]= *(a[i][j]+k)
= *(*(a[i]+j)+k)
= *(*(*(a+i)+j)+k)

Kuttu said: (Wed, Jul 6, 2011 05:45:09 AM)    
 
Thanks anil kumar.

Bhuvana said: (Fri, Jul 8, 2011 10:24:55 AM)    
 
Thanks ramanji.

Ashok said: (Fri, Aug 5, 2011 07:08:26 PM)    
 
Given: a[i][j][k][l]

i number of rows with
{
each contains j number of rows with
{
each contains k number of rows with
{
EACH CONTAINS l no of columns
}
}
}

Meenu said: (Sat, Sep 24, 2011 04:36:14 PM)    
 
Explain this concept.

Sagar said: (Tue, Oct 18, 2011 10:08:32 PM)    
 
Thanks pradeep

Rajesh said: (Wed, Oct 19, 2011 10:39:59 PM)    
 
Nice Explanation by ramaji & pradeep.

Rajesh said: (Wed, Oct 19, 2011 10:39:59 PM)    
 
Nice Explanation by ramaji & pradeep.

Raju Naidu said: (Fri, Oct 28, 2011 11:37:57 AM)    
 
Arrays internally works based on pointers. In arrays each subscript represents one pointer.

Ex:a[1]

Once you compile this code it internally converted into
*(a+1)or*(1+a)

That's y
a[i][j][k][l]---->a[i]--->*(a+i)(one subscript means onepointer)
a[i][j]--->*(*(a+i)+j)(Two subscripts means two pointers)
a[i][j][k]----->*(*(*(a+i)+j)+k)
a[i][j][k][l]---->*(*(*(*(a+i)+j)+k)+l)

Bye friends.

Ravitheja said: (Sat, Nov 5, 2011 04:07:49 PM)    
 
Anil Kumar Kandula.

Thank you very much. Nice eplanation.

Rishabh said: (Fri, Nov 11, 2011 09:52:03 AM)    
 
An another way to represent pointer as array is ?

ptr[0]------>*(ptr+0);
ptr[1]------>*(ptr+1);

Ekansh said: (Fri, Nov 18, 2011 07:44:48 PM)    
 
Nice explanation by pradeep and ramanaji !.

Khushi said: (Fri, Dec 2, 2011 02:22:20 PM)    
 
Thanks raju naidu.

Nice explanation :).

Mrutyunjay said: (Tue, Feb 7, 2012 07:59:53 PM)    
 
We can write a[i] in pointer as *(a + i)
similarly a[i][j] as *(*(a+i)+j)
a[i][j][k] as *(*(*(a+i)+j)+k)
a[i][j][k][l] as *(*(*(*(a+i)+j)+k)+l)

Write your comments here:
Name *:     Email:


© 2008-2011 by IndiaBIX™ Technologies. All Rights Reserved | Copyright | Terms of Use & Privacy Policy

Advertise     Contact us: info@indiabix.com     Follow us on twitter!