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

plz tell me the output of this program??

Discussion in 'Programming' started by gubba, Nov 8, 2011.

  1. gubba

    gubba New Member

    Joined:
    Nov 8, 2011
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Hello frnz..
    I'm a newbie here but not to programming.
    I've got a small doubt with this porgram..
    Code:
    main()
    {
    int *ptr=(int*)malloc(sizeof(int));
    *ptr=4;
    printf("%d",(*ptr)+++*ptr++);
    }
    In this the output it shows is : 16

    But due to operator sideeffect it should be 36..
    am i right??
    plz correct me if I'm wrong.


    waiting for ur replies...
     
    Last edited by a moderator: Nov 8, 2011

Share This Page