Re: why it doesn't work?
- From: CBFalconer <cbfalconer@xxxxxxxxx>
- Date: Wed, 31 Jan 2007 09:14:39 -0500
Chief wrote:
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.....
Of course. See the faq. Links below.
y is this happening??? especially when we know that
*(*(B+1)+2) is legal !!
You haven't defined the variable y. i.e. don't use foolish
abbreviations. Spelling counts.
--
Some useful references about C:
<http://www.ungerhu.com/jxh/clc.welcome.txt>
<http://www.eskimo.com/~scs/C-faq/top.html>
<http://benpfaff.org/writings/clc/off-topic.html>
<http://anubis.dkuug.dk/jtc1/sc22/wg14/www/docs/n869/> (C99)
<http://www.dinkumware.com/refxc.html> (C-library}
<http://gcc.gnu.org/onlinedocs/> (GNU docs)
<http://clc-wiki.net> (C-info)
.
- References:
- why it doesn't work?
- From: Chief
- why it doesn't work?
- Prev by Date: Re: How to reduce Zero Initialised region.
- Next by Date: Re: How to improve this sort?
- Previous by thread: Re: why it doesn't work?
- Next by thread: check if the memory is low, from Windows to Unix
- Index(es):
Relevant Pages
|