Mon Oct 18 17:02:33 2021
EVENTS
 FREE
SOFTWARE
INSTITUTE

POLITICS
JOBS
MEMBERS'
CORNER

MAILING
LIST

NYLXS Mailing Lists and Archives
NYLXS Members have a lot to say and share but we don't keep many secrets. Join the Hangout Mailing List and say your peice.

DATE 2008-08-01

HANGOUT

2021-10-18 | 2021-09-18 | 2021-08-18 | 2021-07-18 | 2021-06-18 | 2021-05-18 | 2021-04-18 | 2021-03-18 | 2021-02-18 | 2021-01-18 | 2020-12-18 | 2020-11-18 | 2020-10-18 | 2020-09-18 | 2020-08-18 | 2020-07-18 | 2020-06-18 | 2020-05-18 | 2020-04-18 | 2020-03-18 | 2020-02-18 | 2020-01-18 | 2019-12-18 | 2019-11-18 | 2019-10-18 | 2019-09-18 | 2019-08-18 | 2019-07-18 | 2019-06-18 | 2019-05-18 | 2019-04-18 | 2019-03-18 | 2019-02-18 | 2019-01-18 | 2018-12-18 | 2018-11-18 | 2018-10-18 | 2018-09-18 | 2018-08-18 | 2018-07-18 | 2018-06-18 | 2018-05-18 | 2018-04-18 | 2018-03-18 | 2018-02-18 | 2018-01-18 | 2017-12-18 | 2017-11-18 | 2017-10-18 | 2017-09-18 | 2017-08-18 | 2017-07-18 | 2017-06-18 | 2017-05-18 | 2017-04-18 | 2017-03-18 | 2017-02-18 | 2017-01-18 | 2016-12-18 | 2016-11-18 | 2016-10-18 | 2016-09-18 | 2016-08-18 | 2016-07-18 | 2016-06-18 | 2016-05-18 | 2016-04-18 | 2016-03-18 | 2016-02-18 | 2016-01-18 | 2015-12-18 | 2015-11-18 | 2015-10-18 | 2015-09-18 | 2015-08-18 | 2015-07-18 | 2015-06-18 | 2015-05-18 | 2015-04-18 | 2015-03-18 | 2015-02-18 | 2015-01-18 | 2014-12-18 | 2014-11-18 | 2014-10-18 | 2014-09-18 | 2014-08-18 | 2014-07-18 | 2014-06-18 | 2014-05-18 | 2014-04-18 | 2014-03-18 | 2014-02-18 | 2014-01-18 | 2013-12-18 | 2013-11-18 | 2013-10-18 | 2013-09-18 | 2013-08-18 | 2013-07-18 | 2013-06-18 | 2013-05-18 | 2013-04-18 | 2013-03-18 | 2013-02-18 | 2013-01-18 | 2012-12-18 | 2012-11-18 | 2012-10-18 | 2012-09-18 | 2012-08-18 | 2012-07-18 | 2012-06-18 | 2012-05-18 | 2012-04-18 | 2012-03-18 | 2012-02-18 | 2012-01-18 | 2011-12-18 | 2011-11-18 | 2011-10-18 | 2011-09-18 | 2011-08-18 | 2011-07-18 | 2011-06-18 | 2011-05-18 | 2011-04-18 | 2011-03-18 | 2011-02-18 | 2011-01-18 | 2010-12-18 | 2010-11-18 | 2010-10-18 | 2010-09-18 | 2010-08-18 | 2010-07-18 | 2010-06-18 | 2010-05-18 | 2010-04-18 | 2010-03-18 | 2010-02-18 | 2010-01-18 | 2009-12-18 | 2009-11-18 | 2009-10-18 | 2009-09-18 | 2009-08-18 | 2009-07-18 | 2009-06-18 | 2009-05-18 | 2009-04-18 | 2009-03-18 | 2009-02-18 | 2009-01-18 | 2008-12-18 | 2008-11-18 | 2008-10-18 | 2008-09-18 | 2008-08-18 | 2008-07-18 | 2008-06-18 | 2008-05-18 | 2008-04-18 | 2008-03-18 | 2008-02-18 | 2008-01-18 | 2007-12-18 | 2007-11-18 | 2007-10-18 | 2007-09-18 | 2007-08-18 | 2007-07-18 | 2007-06-18 | 2007-05-18 | 2007-04-18 | 2007-03-18 | 2007-02-18 | 2007-01-18 | 2006-12-18 | 2006-11-18 | 2006-10-18 | 2006-09-18 | 2006-08-18 | 2006-07-18 | 2006-06-18 | 2006-05-18 | 2006-04-18 | 2006-03-18 | 2006-02-18 | 2006-01-18 | 2005-12-18 | 2005-11-18 | 2005-10-18 | 2005-09-18 | 2005-08-18 | 2005-07-18 | 2005-06-18 | 2005-05-18 | 2005-04-18 | 2005-03-18 | 2005-02-18 | 2005-01-18 | 2004-12-18 | 2004-11-18 | 2004-10-18 | 2004-09-18 | 2004-08-18 | 2004-07-18 | 2004-06-18 | 2004-05-18 | 2004-04-18 | 2004-03-18 | 2004-02-18 | 2004-01-18 | 2003-12-18 | 2003-11-18 | 2003-10-18 | 2003-09-18 | 2003-08-18 | 2003-07-18 | 2003-06-18 | 2003-05-18 | 2003-04-18 | 2003-03-18 | 2003-02-18 | 2003-01-18 | 2002-12-18 | 2002-11-18 | 2002-10-18 | 2002-09-18 | 2002-08-18 | 2002-07-18 | 2002-06-18 | 2002-05-18 | 2002-04-18 | 2002-03-18 | 2002-02-18 | 2002-01-18 | 2001-12-18 | 2001-11-18 | 2001-10-18 | 2001-09-18 | 2001-08-18 | 2001-07-18 | 2001-06-18 | 2001-05-18 | 2001-04-18 | 2001-03-18 | 2001-02-18 | 2001-01-18 | 2000-12-18 | 2000-11-18 | 2000-10-18 | 2000-09-18 | 2000-08-18 | 2000-07-18 | 2000-06-18 | 2000-05-18 | 2000-04-18 | 2000-03-18 | 2000-02-18 | 2000-01-18 | 1999-12-18

Key: Value:

Key: Value:

MESSAGE
DATE 2008-08-30
FROM Ruben Safir
SUBJECT Subject: [NYLXS - HANGOUT] Re: multi-dim arrays in c
From lest-hangout-at-mrbrklyn.com Sat Aug 30 08:46:09 2008
Received: from www2.mrbrklyn.com (localhost [127.0.0.1])
by www2.mrbrklyn.com (8.13.1/8.13.1/SuSE Linux 0.7) with ESMTP id m7UCk6op005928
for ; Sat, 30 Aug 2008 08:46:08 -0400
Received: (from majordomo-at-localhost)
by www2.mrbrklyn.com (8.13.1/8.13.1/Submit) id m7UCk68s005927
for hangout-outgoings; Sat, 30 Aug 2008 08:46:06 -0400
X-Authentication-Warning: www2.mrbrklyn.com: majordomo set sender to lest-hangout-at-nylxs.com using -f
Received: from www2.mrbrklyn.com (localhost [127.0.0.1])
by www2.mrbrklyn.com (8.13.1/8.13.1/SuSE Linux 0.7) with ESMTP id m7UCk4xs005924;
Sat, 30 Aug 2008 08:46:06 -0400
Received: (from ruben-at-localhost)
by www2.mrbrklyn.com (8.13.1/8.13.1/Submit) id m7UCk3XW005923;
Sat, 30 Aug 2008 08:46:03 -0400
Date: Sat, 30 Aug 2008 08:46:03 -0400
From: Ruben Safir
To: Ruben Safir
Cc: Stephen Adler , hangout-at-mrbrklyn.com,
"Blu unix (blu)"
Subject: [NYLXS - HANGOUT] Re: multi-dim arrays in c
Message-ID: <20080830124603.GA5862-at-www2.mrbrklyn.com>
References: <48B86D8C.3040601-at-stephenadler.com> <20080830001635.GB28517-at-www2.mrbrklyn.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <20080830001635.GB28517-at-www2.mrbrklyn.com>
User-Agent: Mutt/1.5.6i
Sender: lest-hangout-at-mrbrklyn.com
Precedence: bulk
Reply-To: hangout-at-mrbrklyn.com

On Fri, Aug 29, 2008 at 08:16:35PM -0400, Ruben Safir wrote:
> On Fri, Aug 29, 2008 at 05:43:40PM -0400, Stephen Adler wrote:
> > Guys,
> >
> > I've got a standard c coding question which has been nagging me for a
> > while and I was wondering what you guys may think or have the correct
> > solution to this problem....
> >
> > Lets say I have a 2 dim array of data and the dimension sizes can change
> > depending on the specific data set. I can read in the x and y dimensions
> > from a file, then read in the x*y elements of the data a populate a
> > memory area x*y*elementsizeinbytes with the data. But now I want to
> > access the data. Without doing pointer arithmatic, is it possible to use
> > the standard [][] notation somehow?
> >
> > for example
> >
> > int *data;
> > x=getXDim();
> > y=getYDim();
> > data=(int *)malloc(x*y*sizeof(int));
> > readInData(x,y,data);
> > printf("Middle data element is %d\n",data[y][x]);
> >
> > but I know that that data[y][x] will barf on the compiler because the
> > compiler has no way of knowing what the y size of the "y" dimension is...
> >
> > Any suggestions on how to use the N-dimensional bracket notation in this
> > situation?
> >
> > Thanks.
> >
>
nclude
#include

int **my;
int x = 100;
int y = 500;
int i = 0;
int j = 0;
int k = 0;
int main(){
my = (int **)malloc(x * sizeof(int*));

for(; i my[i] = (int *)malloc(y * sizeof(int *));
}

for(i = 0; i < x; i++)
for(j=0; j my[i][j] = i + j;
printf ("i=> %d j=> %d slot: %d ==> %d\n",i,j,k,my[i][j]);
k++;
printf("Hello\n");
}

printf("%d", my[0][5]);

return 0;

}




>
> Yes, in fact int main() does this using char** as a parameter.
>
> I have a sample worked out on my laptop which I can't put on my
> jobs network, but when I get home I'll post an example.
>
> Ruben
>
>
> >
> > --
> > This message has been scanned for viruses and
> > dangerous content by MailScanner, and is
> > believed to be clean.
> >
> > _______________________________________________
> > Discuss mailing list
> > Discuss-at-blu.org
> > http://lists.blu.org/mailman/listinfo/discuss
>
> --
> http://www.mrbrklyn.com - Interesting Stuff
> http://www.nylxs.com - Leadership Development in Free Software
>
> 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://fairuse.nylxs.com DRM is THEFT - We are the STAKEHOLDERS - RI Safir 2002
>
> "Yeah - I write Free Software...so SUE ME"
>
> "The tremendous problem we face is that we are becoming sharecroppers to our own cultural heritage -- we need the ability to participate in our own society."
>
> "> I'm an engineer. I choose the best tool for the job, politics be damned.<
> You must be a stupid engineer then, because politcs and technology have been attached at the hip since the 1st dynasty in Ancient Egypt. I guess you missed that one."
>
> © Copyright for the Digital Millennium
>
> --
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.
>
> _______________________________________________
> Discuss mailing list
> Discuss-at-blu.org
> http://lists.blu.org/mailman/listinfo/discuss

--
http://www.mrbrklyn.com - Interesting Stuff
http://www.nylxs.com - Leadership Development in Free Software

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://fairuse.nylxs.com DRM is THEFT - We are the STAKEHOLDERS - RI Safir 2002

"Yeah - I write Free Software...so SUE ME"

"The tremendous problem we face is that we are becoming sharecroppers to our own cultural heritage -- we need the ability to participate in our own society."

"> I'm an engineer. I choose the best tool for the job, politics be damned.<
You must be a stupid engineer then, because politcs and technology have been attached at the hip since the 1st dynasty in Ancient Egypt. I guess you missed that one."

© Copyright for the Digital Millennium

  1. 2008-08-01 Mark Simko <msimko-at-optonline.net> Re: [NYLXS - HANGOUT] Time to trash the eeepc
  2. 2008-08-01 Ruben Safir <ruben-at-mrbrklyn.com> Re: [NYLXS - HANGOUT] Time to trash the eeepc
  3. 2008-08-01 Ruben Safir <ruben-at-mrbrklyn.com> Re: [NYLXS - HANGOUT] Time to trash the eeepc
  4. 2008-08-01 Mark Simko <msimko-at-optonline.net> Re: [NYLXS - HANGOUT] Time to trash the eeepc
  5. 2008-08-01 Ruben Safir <ruben-at-mrbrklyn.com> Re: [NYLXS - HANGOUT] Time to trash the eeepc
  6. 2008-08-01 Matthew <mph-at-dorsai.org> Re: [NYLXS - HANGOUT] Time to trash the eeepc
  7. 2008-08-01 Ruben Safir <ruben-at-mrbrklyn.com> Re: [NYLXS - HANGOUT] Time to trash the eeepc
  8. 2008-08-01 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [NYLXS - HANGOUT] New Movie Event for NYLXS
  9. 2008-08-01 From: "Michael L. Richardson" <mlr52-at-michaellrichardson.com> Re: [NYLXS - HANGOUT] New Movie Event for NYLXS
  10. 2008-08-01 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [NYLXS - HANGOUT] C++ Workshop 2.34
  11. 2008-08-01 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [NYLXS - HANGOUT] [afife-at-untangle.com: [vox] Installfest for Schools (Next Week)]
  12. 2008-08-01 Ruben Safir <ruben-at-mrbrklyn.com> Re: [NYLXS - HANGOUT] New Movie Event for NYLXS
  13. 2008-08-03 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [NYLXS - HANGOUT] Next NYLXS Meeting
  14. 2008-08-03 From: <mlr52-at-michaellrichardson.com> Re: [NYLXS - HANGOUT] Next NYLXS Meeting
  15. 2008-08-04 Ruben Safir <ruben-at-mrbrklyn.com> Re: [NYLXS - HANGOUT] Time to trash the eeepc
  16. 2008-08-07 From: "Michael L. Richardson" <mlr52-at-michaellrichardson.com> Subject: [NYLXS - HANGOUT] Judge mulls frivolousness of God lawsuit
  17. 2008-08-08 From: <mlr52-at-michaellrichardson.com> Subject: [NYLXS - HANGOUT] Fair use copyrite question
  18. 2008-08-08 Ruben Safir <ruben-at-mrbrklyn.com> Re: [NYLXS - HANGOUT] Fair use copyrite question
  19. 2008-08-08 From: <mlr52-at-michaellrichardson.com> Re: [NYLXS - HANGOUT] Fair use copyrite question
  20. 2008-08-08 Elfen Magix <elfen_magix-at-yahoo.com> Re: [NYLXS - HANGOUT] Fair use copyrite question
  21. 2008-08-08 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [NYLXS - HANGOUT] stings lib in C++ and array size
  22. 2008-08-08 From: <mlr52-at-michaellrichardson.com> Re: [NYLXS - HANGOUT] Fair use copyrite question
  23. 2008-08-08 Ruben Safir <ruben-at-mrbrklyn.com> Re: [NYLXS - HANGOUT] Fair use copyrite question
  24. 2008-08-08 From: <mlr52-at-michaellrichardson.com> Re: [NYLXS - HANGOUT] Fair use copyrite question
  25. 2008-08-10 Elfen Magix <elfen_magix-at-yahoo.com> Subject: [NYLXS - HANGOUT] Killing a Posted Refresh
  26. 2008-08-10 Ruben Safir <ruben-at-mrbrklyn.com> Re: [NYLXS - HANGOUT] Killing a Posted Refresh
  27. 2008-08-10 Ruben Safir <ruben-at-mrbrklyn.com> Re: [NYLXS - HANGOUT] Killing a Posted Refresh
  28. 2008-08-11 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [NYLXS - HANGOUT] Free Software Chamber of Commerce: Healthcare Focus
  29. 2008-08-12 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [NYLXS - HANGOUT] [ruben-at-mrbrklyn.com: Re: (Linux ETC: R Safir) [hardhats](offlist) Re: Free Software Chamber of Commerce: Healthcare Focus]
  30. 2008-08-12 From: "Ronny Abraham" <ronny.coder-at-gmail.com> Re: [NYLXS - HANGOUT] Free Software Chamber of Commerce: Healthcare Focus
  31. 2008-08-12 Mark Simko <msimko-at-optonline.net> Re: [NYLXS - HANGOUT] Free Software Chamber of Commerce: Healthcare
  32. 2008-08-12 Mark Simko <msimko-at-optonline.net> Re: [NYLXS - HANGOUT] Judge mulls frivolousness of God lawsuit
  33. 2008-08-12 From: "Michael L. Richardson" <mlr52-at-michaellrichardson.com> Re: [NYLXS - HANGOUT] Judge mulls frivolousness of God lawsuit
  34. 2008-08-13 Elfen Magix <elfen_magix-at-yahoo.com> Subject: [NYLXS - HANGOUT] Desperately Seeking...
  35. 2008-08-13 From: <mlr52-at-michaellrichardson.com> Re: [NYLXS - HANGOUT] Desperately Seeking...
  36. 2008-08-13 Elfen Magix <elfen_magix-at-yahoo.com> Re: [NYLXS - HANGOUT] Desperately Seeking...
  37. 2008-08-13 From: <mlr52-at-michaellrichardson.com> Re: [NYLXS - HANGOUT] Desperately Seeking...
  38. 2008-08-13 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [NYLXS - HANGOUT] [rick-at-linuxmafia.com: [conspire] (forw) Strong Court Ruling Upholds the Artistic License (fwd)]
  39. 2008-08-14 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [NYLXS - HANGOUT] Google and Georgia
  40. 2008-08-14 prmarino1-at-gmail.com Re: [NYLXS - HANGOUT] Google and Georgia
  41. 2008-08-14 prmarino1-at-gmail.com Re: [NYLXS - HANGOUT] Google and Georgia
  42. 2008-08-14 Matthew <mph-at-dorsai.org> Re: [NYLXS - HANGOUT] Google and Georgia
  43. 2008-08-15 Ruben Safir <ruben-at-mrbrklyn.com> Re: [NYLXS - HANGOUT] Google and Georgia
  44. 2008-08-17 From: "Paul Charles Leddy" <pcleddy-at-gmail.com> Re: [NYLXS - HANGOUT] [Volunteer4-at-JohnMcCain.com: McCain Campaign Internships]
  45. 2008-08-19 From: "armando fonseca" <afonsec2-at-gmail.com> Re: [NYLXS - HANGOUT] [Volunteer4-at-JohnMcCain.com: McCain Campaign Internships]
  46. 2008-08-19 From: <tameek-at-gmail.com> RE: [NYLXS - HANGOUT] [Volunteer4-at-JohnMcCain.com: McCain Campaign
  47. 2008-08-23 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [NYLXS - HANGOUT] Pulse Pen and Linux
  48. 2008-08-23 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [NYLXS - HANGOUT] Error in your C++ page on const
  49. 2008-08-24 swd <sderrick-at-optonline.net> Subject: [NYLXS - HANGOUT] SONY VIAO Laptop & openSUSE 11.00 Monitor configuration. Help please.
  50. 2008-08-24 Ruben Safir <ruben-at-mrbrklyn.com> Re: [NYLXS - HANGOUT] SONY VIAO Laptop & openSUSE 11.00 Monitor configuration. Help please.
  51. 2008-08-25 swd <sderrick-at-optonline.net> Subject: [NYLXS - HANGOUT] Re: SONY VIAO Laptop & openSUSE 11.00 Monitor configuration. Help
  52. 2008-08-25 Ruben Safir <ruben-at-mrbrklyn.com> Re: [NYLXS - HANGOUT] Re: SONY VIAO Laptop & openSUSE 11.00 Monitor configuration. Help please.
  53. 2008-08-25 Ruben Safir <ruben-at-mrbrklyn.com> Re: [NYLXS - HANGOUT] C++ Workshop 2.34
  54. 2008-08-26 Elfen Magix <elfen_magix-at-yahoo.com> Subject: [NYLXS - HANGOUT] Suse & FTP
  55. 2008-08-27 Ruben Safir <ruben-at-mrbrklyn.com> Re: [NYLXS - HANGOUT] Suse & FTP
  56. 2008-08-27 Matthew <mph-at-dorsai.org> Re: [NYLXS - HANGOUT] Suse & FTP
  57. 2008-08-27 Mark Simko <msimko-at-optonline.net> Re: [NYLXS - HANGOUT] Suse & FTP
  58. 2008-08-27 Ruben Safir <ruben-at-mrbrklyn.com> Re: [NYLXS - HANGOUT] Suse & FTP
  59. 2008-08-27 swd <sderrick-at-optonline.net> Re: [NYLXS - HANGOUT] Re: SONY VIAO Laptop & openSUSE 11.00 Monitor
  60. 2008-08-27 Ruben Safir <ruben-at-mrbrklyn.com> Re: [NYLXS - HANGOUT] Re: SONY VIAO Laptop & openSUSE 11.00 Monitor configuration. Help please.
  61. 2008-08-27 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [NYLXS - HANGOUT] mac book?
  62. 2008-08-27 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [NYLXS - HANGOUT] Mac Book
  63. 2008-08-27 From: "armando fonseca" <afonsec2-at-gmail.com> Re: [NYLXS - HANGOUT] Re: SONY VIAO Laptop & openSUSE 11.00 Monitor configuration. Help please.
  64. 2008-08-27 Mark Simko <msimko-at-optonline.net> Re: [NYLXS - HANGOUT] Re: SONY VIAO Laptop & openSUSE 11.00 Monitor
  65. 2008-08-28 Ruben Safir <mrbrklyn-at-panix.com> Re: [NYLXS - HANGOUT] Free Software Chamber of Commerce:
  66. 2008-08-28 Ruben Safir <mrbrklyn-at-panix.com> Re: [NYLXS - HANGOUT] August Plans
  67. 2008-08-29 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [NYLXS - HANGOUT] [nbs-at-sonic.net: [vox] Volunteers at Software Freedom Day - discs, too]
  68. 2008-08-29 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [NYLXS - HANGOUT] Re: multi-dim arrays in c
  69. 2008-08-30 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [NYLXS - HANGOUT] Workshop C++ errors
  70. 2008-08-30 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [NYLXS - HANGOUT] Re: multi-dim arrays in c

NYLXS are Do'ers and the first step of Doing is Joining! Join NYLXS and make a difference in your community today!