Quick Question

0 J show · March 10, 2015
char AR[10];
 short WW[13];
double M[100];
char *cp;
short *sp;
short *sp2;
double *dp;

AR is located at address 500
WW is locates at address 2100
 M is located at address 3340

dp = M+9;

Will dp be 3349 because the memory address +9 or do i need to do 8bytes * 9 + 3340?

Post a Reply

Replies

Oldest  Newest  Rating
0 c student · March 11, 2015
just a note, addresses are normally shown in hexadecimal format with the "%x".

also, test it yourself and see, there's really no need to ask.  in fact, you'd learn better if you experience things for yourself.
0 J show · March 11, 2015
Thats true. And yea its hard to tell because they're in hexadecimal. I subtracted dp - M and got 9 but im pretty sure the answer they are looking for is 8 bytes times 9. 
0 J show · March 11, 2015
Thanks for the reply.
  • 1

C

107,346 followers
About

One of the most popular languages of all time.

Links
Moderators
Bucky Roberts Administrator