Thank you, it's clear now. :)
Type: Posts; User: Air
Thank you, it's clear now. :)
int *x, y;
x = y;
Why does that give an error?
Thanks.
Oh yes, that totally makes sence. We were told that pi was equal to num earlier so:
pi+num[2] = num+num[2] = num[3] =12
Thanks a million. I've been confused for quite some time but your...
But *(p+3) would give *(22ff10 + 3) = *(22ff13) which still would be 31 and not 12. I'm not understanding where 12 is comming from.
I assume *(22ff1c )=12 but just given *(22ff1c) how would I be...
\*It is assumed that the addresses of the
variables i, j and the first element of the integer array num in hexadecimal are
22FF6C, 22FF68, 22FF40 respectively.*\
int i, j = 3;
int *pi = &i, *pj...
Thanks.
Theres another error which says that 'n' is undefined in the 'int main()'. How can I bring it from the user defined function?
Yes, so it should be: str* == ch ?
I have to allow a user to input a character. The user then inputs a string and the function is to count the amount of time the character appears in the string. I have produced a user-defined function...
#include<stdio.h>
float SR(float s)
{
float a, b, c;
a = 1;
b = (a + s / a)/2;
c = b - a;
a = b;
When you mean dereference, are we just counting how much the change from the last address to the final address is, because that works out correctly to be 12.
Ooh, that makes sense now. :)
The content of num[2] is 3, isn't it?
Thanks for all the help so far.
Furthermore, these two lines are below the codes on my first post:
printf("%x, %d\n", pi+num[2], *(pi+num[2]));
printf("%x, %d\n", num+5, *(pi+*pj));
What...
If I was just given:
int i=2
Would *i equal the address of i?
Also, if instead given:
Ah, thanks. It makes sense. :)
If it was *pj then would it have made a difference?
But isn't j=pj=4 so the address value will change? At the top, it is 3.
\*It is assumed that the addresses of the
variables i, j and the first element of the integer array num in hexadecimal are
22FF6C, 22FF68, 22FF40 respectively.*\
int i, j = 3;
int *pi = &i, *pj...
Hello, I'm slightly confused with Address aspect.
int i=3
int *pi = &i
^ This means that *pi = 3
int i=3
Just did it manually. Worked out F=15 is last. Thank you both for taking time out to help me. You have both been very clear and patient. Thanks once again. :)
Aah, I see. 15 is the last? Then I assume it goes to: 22FF50, 22FF51, 22FF52, 22FF53, 22FF54, 22FF55, 22FF56, 22FF57, 22FF58, 22FF59, 22FF5A, 22FF5B, 22FF5C, 22FF5D, 22FF5E, 22FF5F, 22FF60
Which letter is last? From 22FF48, it goes to 49, 4A, 4B, 4C. Which is the last letter?
Yes, I understand that j is 12 at this point. But when you mean 12 address, how is it added?
22FF40 + 12 = 22FF(40+12) = 22FF52?
I know, but the data is given.
I would be greatful if anyone could explain the change from 22FF40 to 22FF70.