1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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