Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!snorkelwacker.mit.edu!hsdndev!cmcl2!lanl!cochiti.lanl.gov!jlg From: jlg@cochiti.lanl.gov (Jim Giles) Newsgroups: comp.lang.c Subject: Re: More getch() woes Message-ID: <19058@lanl.gov> Date: 25 Mar 91 17:27:12 GMT References: <669422030.1@opocus.Fidonet.Org> <1991Mar25.145517.3427@viewlogic.com> Sender: news@lanl.gov Reply-To: jlg@cochiti.lanl.gov (Jim Giles) Organization: Los Alamos National Laboratory Lines: 26 In article <1991Mar25.145517.3427@viewlogic.com>, sparks@power.viewlogic.com (Alan Sparks) writes: |> |> In article <669422030.1@opocus.Fidonet.Org> you write: |> >Marc WANDSCHNEIDER writes to All: |> > [...] |> > int i, test, c[25]; |> > i = 0; |> > c = 0; |> ^^^^^^ |> THIS LINE SHOULD NOT COMPILE! |> [...] |> If your compiler let you do the above marked line, it's a bit brain- |> damaged... the standard (either one) does not sanction assignment to |> arrays. Initialization of c[] here should be do with a for loop. The program as written is wrong. But you shouldn't need a for loop. Why not do: int i = 0; int c[25] = {0}; int test; This should do what you want in both K&R and ANSI compliant code. J. Giles