Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c++ > #88215
| From | Lynn McGuire <lynnmcguire5@gmail.com> |
|---|---|
| Newsgroups | comp.lang.c++ |
| Subject | Re: best way to pass a multiple dimension variable to a method |
| Date | 2022-12-22 02:01 -0600 |
| Organization | Aioe.org NNTP Server |
| Message-ID | <to12t4$1j12$1@gioia.aioe.org> (permalink) |
| References | <tnvqqq$1466q$1@dont-email.me> <to00no$14ojn$1@dont-email.me> <873598ta2w.fsf@bsb.me.uk> |
On 12/21/2022 9:02 PM, Ben Bacarisse wrote: > Lynn McGuire <lynnmcguire5@gmail.com> writes: > >> On 12/21/2022 2:37 PM, Lynn McGuire wrote: >>> What is the best way to pass a multiple dimension variable to a method in C++ ? >>> For instance, in C you could do the following: >>> double xyz [5] [2] [14]; >>> ... >>> amethod (xyz, ...); > > Best is always going to depend on lost of as yet unspecified factors. > Are the sizes (other than the "top-level" one) always know at compile > time? Are they always the same? > >> I am looking at >> https://www.educba.com/3d-arrays-in-c-plus-plus/ > > That hardly scratches the surface! > >> and >> >> https://stackoverflow.com/questions/8767166/passing-a-2d-array-to-a-c-function > > C has variably modified types which means you can pass run-time array > sizes to a C function. C++ does not have this feature, but then that > page includes some C++ and does not use variably modified types (as far > as I could see). > > You probably need to say more about your constraints to get better advice. I don't know if the array sizes are always known at compile time. I suspect that they are but I am far from sure. I am moving a 750,000 line F77 / C calculation engine to C++ using a modified version of F2C. F2C converts all multiple dimension arrays to single dimension arrays. Sometimes I convert them back. Still a few unknowns to work out. Thanks, Lynn
Back to comp.lang.c++ | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
best way to pass a multiple dimension variable to a method Lynn McGuire <lynnmcguire5@gmail.com> - 2022-12-21 14:37 -0600
Re: best way to pass a multiple dimension variable to a method Richard Damon <Richard@Damon-Family.org> - 2022-12-21 17:10 -0500
Re: best way to pass a multiple dimension variable to a method Lynn McGuire <lynnmcguire5@gmail.com> - 2022-12-21 16:18 -0600
Re: best way to pass a multiple dimension variable to a method Öö Tiib <ootiib@hot.ee> - 2022-12-21 18:03 -0800
Re: best way to pass a multiple dimension variable to a method David Brown <david.brown@hesbynett.no> - 2022-12-22 15:03 +0100
Re: best way to pass a multiple dimension variable to a method Ben Bacarisse <ben.usenet@bsb.me.uk> - 2022-12-22 03:02 +0000
Re: best way to pass a multiple dimension variable to a method Lynn McGuire <lynnmcguire5@gmail.com> - 2022-12-22 02:01 -0600
Re: best way to pass a multiple dimension variable to a method Öö Tiib <ootiib@hot.ee> - 2022-12-22 00:25 -0800
Re: best way to pass a multiple dimension variable to a method Ben Bacarisse <ben.usenet@bsb.me.uk> - 2022-12-22 12:13 +0000
Re: best way to pass a multiple dimension variable to a method Paavo Helde <eesnimi@osa.pri.ee> - 2022-12-22 09:07 +0200
Re: best way to pass a multiple dimension variable to a method Lynn McGuire <lynnmcguire5@gmail.com> - 2022-12-22 22:10 -0600
Re: best way to pass a multiple dimension variable to a method Lynn McGuire <lynnmcguire5@gmail.com> - 2022-12-22 22:23 -0600
csiph-web