Search:

Type: Posts; User: Air

Page 1 of 2 1 2

Search: Search took 0.02 seconds.

  1. Thread: Pointer/Variable

    by Air
    Replies
    4
    Views
    920

    Thank you, it's clear now. :)

    Thank you, it's clear now. :)
  2. Thread: Pointer/Variable

    by Air
    Replies
    4
    Views
    920

    Pointer/Variable

    int *x, y;
    x = y;

    Why does that give an error?
  3. Thread: Dereferencing

    by Air
    Replies
    7
    Views
    1,837

    Thanks.

    Thanks.
  4. Thread: Dereferencing

    by Air
    Replies
    7
    Views
    1,837

    Oh yes, that totally makes sence. We were told...

    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...
  5. Thread: Dereferencing

    by Air
    Replies
    7
    Views
    1,837

    But *(p+3) would give *(22ff10 + 3) = *(22ff13)...

    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...
  6. Thread: Dereferencing

    by Air
    Replies
    7
    Views
    1,837

    Dereferencing

    \*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...
  7. Replies
    6
    Views
    1,314

    Thanks. Theres another error which says that...

    Thanks.

    Theres another error which says that 'n' is undefined in the 'int main()'. How can I bring it from the user defined function?
  8. Replies
    6
    Views
    1,314

    Yes, so it should be: str* == ch ?

    Yes, so it should be: str* == ch ?
  9. Replies
    6
    Views
    1,314

    Finding Character In String

    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...
  10. Replies
    2
    Views
    10,277

    Squareroot 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;
  11. Thread: Address Printing

    by Air
    Replies
    17
    Views
    2,740

    When you mean dereference, are we just counting...

    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.
  12. Thread: Address Printing

    by Air
    Replies
    17
    Views
    2,740

    Ooh, that makes sense now. :)

    Ooh, that makes sense now. :)
  13. Thread: Address Printing

    by Air
    Replies
    17
    Views
    2,740

    The content of num[2] is 3, isn't it?

    The content of num[2] is 3, isn't it?
  14. Thread: Address Printing

    by Air
    Replies
    17
    Views
    2,740

    Thanks for all the help so far. Furthermore,...

    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...
  15. Thread: Address Printing

    by Air
    Replies
    17
    Views
    2,740

    If I was just given: int i=2 Would *i...

    If I was just given:


    int i=2

    Would *i equal the address of i?

    Also, if instead given:
  16. Thread: Address Printing

    by Air
    Replies
    17
    Views
    2,740

    Ah, thanks. It makes sense. :)

    Ah, thanks. It makes sense. :)
  17. Thread: Address Printing

    by Air
    Replies
    17
    Views
    2,740

    If it was *pj then would it have made a...

    If it was *pj then would it have made a difference?
  18. Thread: Address Printing

    by Air
    Replies
    17
    Views
    2,740

    But isn't j=pj=4 so the address value will...

    But isn't j=pj=4 so the address value will change? At the top, it is 3.
  19. Thread: Address Printing

    by Air
    Replies
    17
    Views
    2,740

    Address Printing

    \*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...
  20. Thread: Address Of Integer

    by Air
    Replies
    6
    Views
    1,570

    Address Of Integer

    Hello, I'm slightly confused with Address aspect.



    int i=3
    int *pi = &i
    ^ This means that *pi = 3


    int i=3
  21. Replies
    10
    Views
    3,703

    Just did it manually. Worked out F=15 is last....

    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. :)
  22. Replies
    10
    Views
    3,703

    Aah, I see. 15 is the last? Then I assume it goes...

    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
  23. Replies
    10
    Views
    3,703

    Which letter is last? From 22FF48, it goes to 49,...

    Which letter is last? From 22FF48, it goes to 49, 4A, 4B, 4C. Which is the last letter?
  24. Replies
    10
    Views
    3,703

    Yes, I understand that j is 12 at this point. But...

    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?
  25. Replies
    10
    Views
    3,703

    I know, but the data is given. I would be...

    I know, but the data is given.



    I would be greatful if anyone could explain the change from 22FF40 to 22FF70.
Results 1 to 25 of 26
Page 1 of 2 1 2