rgb192
asked on
what is a+j
note: I change i to j because i is italic in ee
output
address =&A[j] = (A+j)
value= A[j] = *(A+j)
what is A+J
#include <stdio.h>
#include <string.h>
main()
{
//int A[];
int A[]={2,4,5,8,1};
printf("%d\n",A);
printf("%d\n",&A[0]);
printf("%d\n",A[0]);
printf("%d\n",*A);
//int *p = A;
int j;
for(j = 0;j<5;j++)
{
printf("variable a[j]: address=%d value=%d\n",&A[j],A[j]);
//printf("variable a:::: address=%d value=%d\n",&A,*A);
printf("variable a+j:: address=%d value=%d\n",&A+j,*(A+j));
}
}
output
-1524265408
-1524265408
2
2
variable a[j]: address=-1524265408 value=2
variable a+j:: address=-1524265408 value=2
variable a[j]: address=-1524265404 value=4
variable a+j:: address=-1524265388 value=4
variable a[j]: address=-1524265400 value=5
variable a+j:: address=-1524265368 value=5
variable a[j]: address=-1524265396 value=8
variable a+j:: address=-1524265348 value=8
variable a[j]: address=-1524265392 value=1
variable a+j:: address=-1524265328 value=1
address =&A[j] = (A+j)
value= A[j] = *(A+j)
what is A+J
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Did someone claim that it was?
ASKER
&(j[A]) == &(A[j])
(A+j) == (j+A)
what is j[A]
is j an array or list?
is A an array or list?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks.
i did not fully understand your answers so just need to trust and move on to a debugger local window which is my next question
https://www.experts-exchange.com/questions/28499114/modify-code-so-I-can-see-values-in-a-local-debugger-window.html
i did not fully understand your answers so just need to trust and move on to a debugger local window which is my next question
https://www.experts-exchange.com/questions/28499114/modify-code-so-I-can-see-values-in-a-local-debugger-window.html
>> j[A] is A[j]
It is rare to see j[A]. A[j] is the norm.
It is rare to see j[A]. A[j] is the norm.
ASKER
i do not understand &(j[A])