help me solve this question

Discussion in 'C++' started by imported_wizzy, Jun 7, 2011.

  1. imported_wizzy

    imported_wizzy New Member

    Joined:
    Jun 7, 2011
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    A variable n of data type int is assigned a value 10 and accessed via a pointer ipt. After an increment of 2 on the value of ipt , what will become the value of n?
    write out the code for this task
     
  2. DRK

    DRK New Member

    Joined:
    Apr 13, 2012
    Messages:
    44
    Likes Received:
    3
    Trophy Points:
    0
    Code:
    int n = 10;
    int *ipt = &n;
    *ipt += 2;
    printf("%d", n);
     

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