What does this mean? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

What does this mean?

A[1] = * (a +2);

28th Nov 2016, 9:49 AM
Nazar Beiar
Nazar Beiar - avatar
4 Answers
+ 3
@Mohammed, it's wrong. Assigning the value a[2] to A [1]. Thanks for correcting
28th Nov 2016, 11:08 AM
Venkatesh(Venki)
Venkatesh(Venki) - avatar
+ 2
Here we are having an array 'A' and pointer of same type 'a'. Assigning 2nd element of array A(A[1]) to 3rd element of pointer 'a'(*(a+2)). Hope you understand, but there is a chance of confusing here because of name. Let me know if you're not clear
28th Nov 2016, 10:31 AM
Venkatesh(Venki)
Venkatesh(Venki) - avatar
+ 1
no problem! happens some time ;)
28th Nov 2016, 11:16 AM
Mohammed Maaz
Mohammed Maaz - avatar
0
Venkatesh(Venki) are we assigning a[2]'s value to A[1] or A[1]'s value to a[2]? I think you've mistakenly wrote the opposite.
28th Nov 2016, 11:03 AM
Mohammed Maaz
Mohammed Maaz - avatar