help on c

Discussion in 'C' started by debabrata, Nov 11, 2010.

  1. debabrata

    debabrata New Member

    Joined:
    Sep 27, 2010
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    0
    Hello everyone, I need some details about various types of variables used in C(like local,global,static,const,extern,volatile) & also their behavior inside functions.

    For ex:- what will be the output of the program, with reason

    void main()
    {
    int i=2,j=4;
    func(i , &j);
    printf("i=%d j=%d",i,j);
    }

    void func(int a, int *b)
    {
    i=i*i;
    *j=*j * *j;
    }
     
  2. xpi0t0s

    xpi0t0s Mentor

    Joined:
    Aug 6, 2004
    Messages:
    3,009
    Likes Received:
    203
    Trophy Points:
    63
    Occupation:
    Senior Support Engineer
    Location:
    England
    What happens if you try it?
    Personally I don't think you'll get ANY output, I think the compiler will throw errors.
     

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