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

help with confusing declarations please

Discussion in 'C' started by csepraveenkumar, Mar 19, 2011.

  1. csepraveenkumar

    csepraveenkumar New Member

    Joined:
    Mar 19, 2011
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    in k&r c the following declaration is given to be pointer to array[13] of int
    Code:
    int (*daytab)[13]
    on similar lines i initialize a pointer to array[2]of int in my program as follows
    Code:
    int c[2];
    int (*d)[2];
    d=c;
    when compiling this code i get a warning as follows
    Code:
    sizeof.c: In function ‘main’:
    sizeof.c:7: warning: assignment from incompatible pointer type
    what is generating this warning and how to get rid of it? also are there any good resources for understanding complicated declarations in c?
     
  2. DRK

    DRK New Member

    Joined:
    Apr 13, 2012
    Messages:
    44
    Likes Received:
    3
    Trophy Points:
    0
    d is a table of pointers to int, so
    Code:
    d=&c;
     

Share This Page