delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2011/08/26/17:45:16

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
From: Mok-Kong Shen <mok-kong DOT shen AT t-online DOT de>
Newsgroups: comp.os.msdos.djgpp
Subject: Array initialization question
Date: Fri, 26 Aug 2011 23:36:47 +0200
Organization: albasani.net
Lines: 17
Message-ID: <j393ip$q9n$1@news.albasani.net>
Mime-Version: 1.0
X-Trace: news.albasani.net H9erp4cwdbexA2q+kJ7/S+Y4+W6L1p8AONIh1NsM/fZceDRWdcijrPM045N+C3uM+WaDYdD4sjjbjfVfas1xRCs5tl+BgsNRU56au8px7SzuwtEjUHE8Is1lzjZjoN9t
NNTP-Posting-Date: Fri, 26 Aug 2011 21:35:21 +0000 (UTC)
Injection-Info: news.albasani.net; logging-data="Jl2z7SEG37jgvgT+sPsItQyUDNYwfwVZDjslCXyRc6Kp0ebSrv9N08QUjyIgKMhPKXR4xq4OJTxxjAd/Syxc2huoFwkSaMUzoOf+Mx8HxSCbdg5PI/vjGPwmKdzQY+oA"; mail-complaints-to="abuse AT albasani DOT net"
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:6.0) Gecko/20110812 Thunderbird/6.0
Cancel-Lock: sha1:XK6Jt8TElgakUUt8ujxc3uekIE4=
Bytes: 1510
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

I found that lines like

   const int sz=3;
   int arr[sz];

seem to work well as C code. However I can't have an initialization list 
e.g.

   int arr[sz]={ 0,1,2 };

On the other hand such initialization lists seem to be ok for codes
running in Visual C++. Is this due to a difference between standards
of C and C++?

Thanks in advance.

M. K. Shen

- Raw text -


  webmaster     delorie software   privacy  
  Copyright 2019   by DJ Delorie     Updated Jul 2019