Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #15225

Re: passing static 2D array to function - not fully working like I hoped for...

From James Kuyper <jameskuyper@verizon.net>
Newsgroups comp.lang.c
Subject Re: passing static 2D array to function - not fully working like I hoped for...
Date 2011-12-29 21:30 -0500
Organization A noiseless patient Spider
Message-ID <jdj7nm$afu$1@dont-email.me> (permalink)
References (1 earlier) <qu9pf7lb9892v51fmdfr082hppso4spvdq@4ax.com> <aa63c87c-16f7-4228-b965-cb144c00fd54@q9g2000yqe.googlegroups.com> <slrnjfph92.pfq.usenet-nospam@guild.seebs.net> <4EFCF7E2.4030105@verizon.net> <slrnjfpvts.vvb.usenet-nospam@guild.seebs.net>

Show all headers | View raw


On 12/29/2011 07:03 PM, Seebs wrote:
> On 2011-12-29, James Kuyper <jameskuyper@verizon.net> wrote:
>> The modification he wants to perform presents pretty much the same
>> issues in C++ as it does in C; it's merely a coincidence that he's
>> asking about this modification at the same time he decided to change
>> languages.
> 
> But it's also a coincidence that it offers the same issues in both languages;
> there are lots of changes you might make which wouldn't.
> 
> And that's the thing; a lot of the posters here wouldn't know whether the
> issues would be the same in C++ or not, and can't test the code as is on a
> C compiler...
> 
>> If I'm right, and he is looking for a solution that can be compiled by a
>> conforming C compiler, why is this NOT the right place for him to ask
>> such questions?
> 
> Oh, that might be.  But...
> 
> If he's offering something that cannot possibly ever have even been waved in
> the direction of a C compiler, the first interpretation that leaps to mind
> is not "I am later going to have rewritten large hunks of this into C, at
> which point I want to know how I'd do this."
> 
> Basically...  If the question is about the code as is, it's going to get just
> as good answers, or better, in a C++ forum.  If it's about a hypothetical
> translation of the code to C, it seems premature.  Anything that is using
> references strikes me as pretty likely to be changed significantly by a
> conversion to C.

Not really - if I were handling it, the first step of the conversion
would be to convert the references to pointers, with corresponding
syntax changes in several locations. My second step would have been to
notice that there was no good reason to use pointers; but under the
circumstances, it seems unlikely that the OP would have noticed that
issue. The only other change that seems required is to replace

	cout << "hi" << endl;

with
	printf("hi\n");

Were there any other changes needed?
-- 
James Kuyper

Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

passing static 2D array to function - not fully working like I hoped for... someone <newsboost@gmail.com> - 2011-12-29 09:11 -0800
  Re: passing static 2D array to function - not fully working like I hoped for... Ben Bacarisse <ben.usenet@bsb.me.uk> - 2011-12-29 17:27 +0000
    Re: passing static 2D array to function - not fully working like I hoped for... someone <newsboost@gmail.com> - 2011-12-29 10:55 -0800
  Re: passing static 2D array to function - not fully working like I hoped for... jt@toerring.de (Jens Thoms Toerring) - 2011-12-29 17:34 +0000
    Re: passing static 2D array to function - not fully working like I hoped for... someone <newsboost@gmail.com> - 2011-12-29 11:03 -0800
      Re: passing static 2D array to function - not fully working like I hoped for... jt@toerring.de (Jens Thoms Toerring) - 2011-12-29 19:38 +0000
        Re: passing static 2D array to function - not fully working like I hoped for... "BartC" <bc@freeuk.com> - 2011-12-29 23:19 +0000
          Re: passing static 2D array to function - not fully working like I hoped for... "BartC" <bc@freeuk.com> - 2011-12-31 11:29 +0000
        Re: passing static 2D array to function - not fully working like I hoped for... 88888 Dihedral <dihedral88888@googlemail.com> - 2011-12-29 17:26 -0800
      Re: passing static 2D array to function - not fully working like I hoped for... Keith Thompson <kst-u@mib.org> - 2011-12-29 11:58 -0800
        Re: passing static 2D array to function - not fully working like I hoped for... Tim Rentsch <txr@alumni.caltech.edu> - 2012-01-25 17:45 -0800
          Re: passing static 2D array to function - not fully working like I hoped for... Kaz Kylheku <kaz@kylheku.com> - 2012-01-26 02:08 +0000
      Re: passing static 2D array to function - not fully working like I hoped for... James Kuyper <jameskuyper@verizon.net> - 2011-12-29 15:35 -0500
        Re: passing static 2D array to function - not fully working like I hoped for... Keith Thompson <kst-u@mib.org> - 2011-12-29 13:25 -0800
          Re: passing static 2D array to function - not fully working like I hoped for... "io_x" <a@b.c.invalid> - 2011-12-31 16:32 +0100
            Re: passing static 2D array to function - not fully working like I hoped for... 88888 Dihedral <dihedral88888@googlemail.com> - 2011-12-31 15:10 -0800
              Re: passing static 2D array to function - not fully working like I hoped for... "osmium" <r124c4u102@comcast.net> - 2011-12-31 18:03 -0600
      Re: passing static 2D array to function - not fully working like I hoped for... Ben Bacarisse <ben.usenet@bsb.me.uk> - 2011-12-29 20:37 +0000
        Re: passing static 2D array to function - not fully working like I hoped for... jgk@panix.com (Joe keane) - 2012-01-03 15:48 +0000
          Re: passing static 2D array to function - not fully working like I hoped for... Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-01-03 16:47 +0000
          Re: passing static 2D array to function - not fully working like I hoped for... Phil Carmody <thefatphil_demunged@yahoo.co.uk> - 2012-01-05 22:31 +0200
      Re: passing static 2D array to function - not fully working like I hoped for... Nobody <nobody@nowhere.com> - 2011-12-31 09:23 +0000
        Re: passing static 2D array to function - not fully working like I hoped for... Keith Thompson <kst-u@mib.org> - 2011-12-31 11:04 -0800
          Re: passing static 2D array to function - not fully working like I hoped for... Nobody <nobody@nowhere.com> - 2012-01-01 08:20 +0000
  Re: passing static 2D array to function - not fully working like I hoped for... Barry Schwarz <schwarzb@dqel.com> - 2011-12-29 09:49 -0800
    Re: passing static 2D array to function - not fully working like I hoped for... someone <newsboost@gmail.com> - 2011-12-29 11:13 -0800
      Re: passing static 2D array to function - not fully working like I hoped for... Seebs <usenet-nospam@seebs.net> - 2011-12-29 19:22 +0000
        Re: passing static 2D array to function - not fully working like I hoped for... someone <newsboost@gmail.com> - 2011-12-29 13:29 -0800
          Re: passing static 2D array to function - not fully working like I hoped for... Seebs <usenet-nospam@seebs.net> - 2011-12-29 21:42 +0000
            Re: passing static 2D array to function - not fully working like I hoped for... someone <newsboost@gmail.com> - 2011-12-29 15:28 -0800
          Re: passing static 2D array to function - not fully working like I hoped for... Keith Thompson <kst-u@mib.org> - 2011-12-29 14:46 -0800
        Re: passing static 2D array to function - not fully working like I hoped for... James Kuyper <jameskuyper@verizon.net> - 2011-12-29 18:29 -0500
          Re: passing static 2D array to function - not fully working like I hoped for... Seebs <usenet-nospam@seebs.net> - 2011-12-30 00:03 +0000
            Re: passing static 2D array to function - not fully working like I hoped for... James Kuyper <jameskuyper@verizon.net> - 2011-12-29 21:30 -0500
        Re: passing static 2D array to function - not fully working like I hoped for... Tim Rentsch <txr@alumni.caltech.edu> - 2012-01-25 17:47 -0800
  Re: passing static 2D array to function - not fully working like I hoped for... Tim Rentsch <txr@alumni.caltech.edu> - 2012-01-25 17:39 -0800

csiph-web