Wht is is the output of following code and why?

Discussion in 'C Programming' started by heenagoyal11, May 1, 2012.

  1. heenagoyal11

    heenagoyal11

    Joined:
    May 1, 2012
    Messages:
    1
    char a[5]={1,2,3,4,5};
    int *b=(int*) a;
    printf("%d",b[1]);
    heenagoyal11, May 1, 2012
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ashish
    Replies:
    3
    Views:
    3,990
    Naveen K Kohli
    Sep 7, 2004
  2. Mr. SweatyFinger
    Replies:
    2
    Views:
    1,763
    Smokey Grindel
    Dec 2, 2006
  3. code break

    Wht you mean this declaration..

    code break, Dec 7, 2006, in forum: C Programming
    Replies:
    3
    Views:
    426
  4. code break

    Wht you mean by this declaration..

    code break, Dec 7, 2006, in forum: C Programming
    Replies:
    1
    Views:
    291
    matevzb
    Dec 7, 2006
  5. 1981ami@gmail.com

    wht's

    1981ami@gmail.com, Apr 21, 2007, in forum: C Programming
    Replies:
    5
    Views:
    424
    Malcolm McLean
    Apr 21, 2007
Loading...

Share This Page