Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / November 2006

Tip: Looking for answers? Try searching our database.

Aray and pointer

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Le Minh - 23 Nov 2006 22:50 GMT
In Visual C++ we use
double  **m_domimage[4];
for 3dimension array which has one fix length.

How do we use this method in C#?

thanks
David Boucherie & Co - 24 Nov 2006 00:43 GMT
> In Visual C++ we use double  **m_domimage[4]; for 3dimension array which
> has one fix length.
>
> How do we use this method in C#?

private double[][][] dominage = new double[ 4 ][][];

That being an array of an array of an array of doubles.
With the new operator, you fix the first dimension on 4 in this case.

When using, you will do things like:
dominage[ 0 ] = new double[ 5 ][];
dominage[ 0 ][ 0 ] = new double[ 6 ];
dominage[ 0 ][ 0 ][ 0 ] = Math.PI;

etc.

If you want a fixed 3D matrix, then you would declare as:

private double[ , , ] dom = new double[ 4, 5, 6 ];

This is obviously a 4x5x6 matrix.

Or any combination of the above.
Have fun. :)

David

Note: I used "dominage" as name, instead of "m_dominage". The first is
C# convention (camel case for private data members), the latter C++
convention.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.