# Thread: Arrays

1. ## Arrays

if we declare: int a[4][3]; then a[i][j] is equalivent to:

1. *(a[i]+j)
2. *(&a[0][0]+4*i+j)
3. Both 1 and 2
4. none of the above.

Please assist in this question

2. Try compiling each one of those and see what happens.

3. Originally Posted by guoer
if we declare: int a[4][3]; then a[i][j] is equalivent to:

1. *(a[i]+j)
2. *(&a[0][0]+4*i+j)
3. Both 1 and 2
4. none of the above.

Please assist in this question
Do your own homework!

QuantumPete

4. Could any expert kindly assist? Or should i say the question is too hard to the experts over here?

5. Originally Posted by guoer
Could any expert kindly assist? Or should i say the question is too hard to the experts over here?
Read about the homework policy. It does not take an expert to answer your question correctly.

Take this as an unofficial warning: do not try emotional blackmail by implying that if we do not spoonfeed you the answer, we must be incompetent.

6. Originally Posted by guoer
Could any expert kindly assist? Or should i say the question is too hard to the experts over here?
No, it is a case of : You figure out what it does, and then we can either EXPLAIN why it is that way, or tell you where you went wrong, if you get it wrong. It is not "ask a question and get the answer", when the actual purpose of the question itself is that you should learn something.

And just so that we can rule out that I'm waiting for your input to know the answer, here's the answer encrypted:
Where n is the question number, x = correct answer:
Code:
`x = (8 >> (n+2));`
--
Mats

Popular pages Recent additions