MESSAGE
DATE | 2016-03-07 |
FROM | Ruben Safir
|
SUBJECT | Re: [Hangout-NYLXS] Announcement: Workshop Organizational Meeting
|
On 03/06/2016 11:45 PM, as9795-at-nyu.edu wrote: > Yes you could say I'm a bit confused
#include
void test_arrays(int a, int b, int matrix[][4]);
int main(int argv, char * argc ) { int array[4][4]={ {1,2,3,4}, {11,12,13,14},{21,22,23,24},{101,102,103,104}}; unsigned int i, j; for(i=0; i<4; i++){ for(j=0; j<4; j++){ printf("%d\t", array[i][j]); } printf("\n"); } printf("\n"); test_arrays(4,4,array); return 0; }
void test_arrays(int a, int b, int matrix[][4]){ printf("This is the first element of the matrix %d \n", *matrix); printf("This is the first element of the *matrix %d \n", **matrix); }
what does this code do? and why?
> > Sent from my iPhone > >> On Mar 6, 2016, at 11:40 PM, Ruben Safir wrote: >> >>> On 03/06/2016 11:38 PM, as9795-at-nyu.edu wrote: >>> Well I did that on purpose to show you! Remember you asked what would happen if I had array+1 ? Isn't this exactly that? It accesses memory on the stack that we didn't initialize >> >> Ah - well then I didn't explain myself well then. You must be puzzled >> as to what I'm trying to ask. >> >> >> -- >> So many immigrant groups have swept through our town >> that Brooklyn, like Atlantis, reaches mythological >> proportions in the mind of the world - RI Safir 1998 >> http://www.mrbrklyn.com >> >> DRM is THEFT - We are the STAKEHOLDERS - RI Safir 2002 >> http://www.nylxs.com - Leadership Development in Free Software >> http://www2.mrbrklyn.com/resources - Unpublished Archive >> http://www.coinhangout.com - coins! >> http://www.brooklyn-living.com >> >> Being so tracked is for FARM ANIMALS and and extermination camps, >> but incompatible with living as a free human being. -RI Safir 2013 >> _______________________________________________ >> hangout mailing list >> hangout-at-nylxs.com >> http://www.nylxs.com/ > _______________________________________________ > hangout mailing list > hangout-at-nylxs.com > http://www.nylxs.com/ >
-- So many immigrant groups have swept through our town that Brooklyn, like Atlantis, reaches mythological proportions in the mind of the world - RI Safir 1998 http://www.mrbrklyn.com
DRM is THEFT - We are the STAKEHOLDERS - RI Safir 2002 http://www.nylxs.com - Leadership Development in Free Software http://www2.mrbrklyn.com/resources - Unpublished Archive http://www.coinhangout.com - coins! http://www.brooklyn-living.com
Being so tracked is for FARM ANIMALS and and extermination camps, but incompatible with living as a free human being. -RI Safir 2013 _______________________________________________ hangout mailing list hangout-at-nylxs.com http://www.nylxs.com/
|
|