dsenic464's Profile User Rating: -----

Reputation: 0 Apprentice
Group:
New Members
Active Posts:
2 (0 per day)
Joined:
11-February 09
Profile Views:
244
Last Active:
User is offline Jul 09 2012 06:31 AM
Currently:
Offline

Previous Fields

Dream Kudos:
0

Latest Visitors

No latest visitors to show

Icon   dsenic464 has not set their status

Posts I've Made

  1. In Topic: Beginning x86 Assembly: Pointers, Addresses, Registers and the CPU.

    Posted 9 Jul 2012

    Look at this segment:

    int pointer = 0x46;

    int *point = pointer;

    Whoa, what's that star? That's a pointer.
    In C++/C you define a pointer with an asterisk sign(*). Breaking it down, you can see that the

    >>
    variable point is pointing to the value of pointer which is 0x46(hexadecimal) which in decimal(base 10) 70.
    <<

    Variable POINT does NOT point to the variable POINTER; Variable POINT, in that case, HAS THE VALUE of the varialbe POINTER; If You wish the variable POINT to REALLY POINT TO the variable POINTER, You have to write:

    int pointer = 0x46;
    int *point = &pointer;

    The sign '&' is the hearth of the story You talking about.
    Next, the '*' is NOT the pointer by itself - it just DENOTES that variable POINT is POINTER.

    Regards!
    D.S.

    Next thing I wish to warn You at, is the following:


    int address = 0x46; //Same thing as before..but..
    int addressOfThat = &address;

    In some cases, You can get the compiler error (or, in best case, compiler's warning), which will tell You that You have to use TYPE CASTING, that is:

    int address = 0x46;
    int addressOfThat = (int)&address;

    This error/warning could be issued due to the reason that the address of some variable is interpreted as UNSIGNED int.

    Regards,
    D.S.

My Information

Member Title:
New D.I.C Head
Age:
Age Unknown
Birthday:
Birthday Unknown
Gender:

Contact Information

E-mail:
Private

Friends

dsenic464 hasn't added any friends yet.

Comments

dsenic464 has no profile comments yet. Why not say hello?