linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Scott <drmemory@3rivers.net>
To: linux-c-programming@vger.kernel.org
Subject: Re: Initializer element is not constant
Date: Fri, 21 Jan 2005 14:31:57 -0700	[thread overview]
Message-ID: <20050121213157.GC977@drmemory.local> (raw)
In-Reply-To: <41F15CEA.2070806@hq.ntsp.nec.co.jp>

On Sat, Jan 22, 2005 at 03:50:02AM +0800, Ron Michael Khu wrote:
> but u can.... =)
> have u tried dynamically allocating space for recip_data?? instead of 
> the usual static declaration?
> char a[10] <-- this is static
> char a[]= {'1','2','3','4'} <-- this is static with definition and 
> declartion in one
> char *a = calloc.....
> 
> have u tried it? using malloc/calloc for defining DATUM recip_data??

Well yes, I guess I could [m|c]alloc the recip_data array. But how do I
then populate it?

 recip_data[0].var = namectrl;
 recip_data[0].len = NAMECTRL_LEN;
 recip_data[0].xlat = make_upper;
etc...

How tedious is THAT!? Especially considering that the code has
eight such arrays, averaging 6 elements per array.

Maybe I'm not understanding your suggestion. As I mentioned, it has
been quite a while since I did any c programming. I just find it
strange that code which compiled fine 20 years ago now will not. I
could understand if it just generated warnings....



  reply	other threads:[~2005-01-21 21:31 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-20 23:21 Initializer element is not constant Scott
     [not found] ` <41F06AC1.2000605@hq.ntsp.nec.co.jp>
2005-01-21  2:37   ` Ron Michael Khu
2005-01-21 16:27     ` Scott
2005-01-21 17:46       ` Ron Michael Khu
2005-01-21 18:54         ` Scott
2005-01-21 19:50           ` Ron Michael Khu
2005-01-21 21:31             ` Scott [this message]
2005-01-22 21:12               ` Christoph Bussenius
2005-01-24 20:44                 ` Scott
  -- strict thread matches above, loose matches on Subject: below --
2005-01-24 21:09 Huber, George K RDECOM CERDEC STCD SRI
2005-01-24 21:28 ` Scott

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050121213157.GC977@drmemory.local \
    --to=drmemory@3rivers.net \
    --cc=linux-c-programming@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).