why it doesn't work?



hey you guys(and girls)....

if B is a 1D array (for instance int B[3]) and C is an int* pointer
(int*) then i can write C=B and everything will be cool.
but if B is a 2D array (for instance int B[3][5]) and C ia an int**
pointer (int**) then the same line , C=B, generates a warning
(incompatible types) and further use of C as a 2D array gets a runtime
error.....

y is this happening??? especially when we know that *(*(B+1)+2)
is legal !!


10x a lot,
the confused C-lover....

.



Relevant Pages

  • Re: Warning on assigning a function-returning-a-pointer-to-arrays
    ... This declares pfunc as a function taking no arguments and returning ... int x, y; ... Presumably pfuncwill return a pointer to a single int, ... or the first of a sequence of "array 5 of int"s. ...
    (comp.lang.c)
  • Re: Newbie
    ... to talk about the int value 3 and the int value 4, ... It also lets you talk about pointer ... C has a special rule for array objects. ... to printf() is: ...
    (comp.lang.c)
  • Re: union {unsigned char u[10]; ...}
    ... But character type is not a union. ... u.a is of type int. ... has to do so to make pointer equality work consistently). ... were a single-element array. ...
    (comp.lang.c)
  • Re: union {unsigned char u[10]; ...}
    ... But character type is not a union. ... u.a is of type int. ... has to do so to make pointer equality work consistently). ... were a single-element array. ...
    (comp.lang.c)
  • Re: How to pass a pointer to an unknown-size array?
    ... > I can pass a "pointer to a double" to a function that accepts ... > int func{ ... > Now I want to pass a pointer to an array of doubles, ...
    (comp.lang.c)