Casting

Discussion in 'C' started by boschow, Mar 21, 2008.

  1. boschow

    boschow New Member

    Joined:
    Feb 22, 2007
    Messages:
    32
    Likes Received:
    0
    Trophy Points:
    0
    Hello,

    I am programing in C and i have an array of chars a[20], and I have an int b. I am triing to copy the fourth element of the array a[3] into the int b. I wrote something like this:

    Code:
    a= (int*)&prcsData->appData[3];
    
    But the rezult isn't what i was expecting. Can you please have a look and tell me what i am doing wrong ?

    Best Regards,
    BoSCHoW.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice