please help me solve this.

Discussion in 'C' started by singh_r85, May 27, 2010.

  1. singh_r85

    singh_r85 New Member

    Joined:
    May 25, 2010
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    0
    What is the output?
    Code:
    #include<stdio.h>
    main(0
    {
    const int val=5;
    const int *ptrval;
    ptrval=&val;
    *ptrval=10;
    printf("%d",val);
    }
     
  2. spoddar66

    spoddar66 New Member

    Joined:
    May 25, 2010
    Messages:
    23
    Likes Received:
    0
    Trophy Points:
    0
    Compiler Error Constant value can't be changed and also the coding contain error, by mistake the main function closed parenthesis is wrong typing '0'. Replace 0 by )
     

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