home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: sparky!uunet!usc!sol.ctr.columbia.edu!emory!swrinde!ringer!pnarsipu
- From: pnarsipu@ringer.cs.utsa.edu (Praasad Y. Narsipur)
- Subject: Re: Few simple questions
- Message-ID: <1993Jan22.225219.18959@ringer.cs.utsa.edu>
- Organization: University of Texas at San Antonio
- References: <1993Jan21.001022.46578@kuhub.cc.ukans.edu>
- Date: Fri, 22 Jan 1993 22:52:19 GMT
- Lines: 72
-
- In article <1993Jan21.001022.46578@kuhub.cc.ukans.edu> kugold@kuhub.cc.ukans.edu writes:
- >L.S.
- >
- >I have a few questions (I am programming in ANSI-C on a UNIX machine) :
- >
- >1. In unix, the backspace key does not work properly. I already
- > found out that this can be changed by typing stty erase ^?, where '^?'
- > means ctrl-?. I tried to include this in my .login file, but emacs does
- > not accept ^?. How do I put this line in my .login file?
- >
- >2. In C I need an input function like INKEY$ in BASIC, that is a function that
- > does _not_ wait for input, but just an empty string or so returns if no
- > character is entered. (I am trying to measure the time between two key-
- > presses). Does this function exist, and if not, is there any way to do
- > what I want?
- >
- >3. In C again, I want to initialize and array of integers, like
- >
- > main()
- > {
- > int ttime[6]={0,0,0,0,0,0}
- > /* rest of program */
- > }
- >
- > but the compiler keeps saying:
- >
- >"
- >ccom: Error: tr.c, line 12: no automatic aggregate initialization
- > int ttime[6]={0,0,0,0,0,0};
- > ------------------^
- >ccom: Error: tr.c, line 12: illegal lhs of assignment operator
- > int ttime[6]={0,0,0,0,0,0};
- > ---------------------^
- >ccom: Error: tr.c, line 12: illegal lhs of assignment operator
- > int ttime[6]={0,0,0,0,0,0};
- > -----------------------^
- >ccom: Error: tr.c, line 12: illegal lhs of assignment operator
- > int ttime[6]={0,0,0,0,0,0};
- > -------------------------^
- >ccom: Error: tr.c, line 12: illegal lhs of assignment operator
- > int ttime[6]={0,0,0,0,0,0};
- > ---------------------------^
- >ccom: Error: tr.c, line 12: illegal lhs of assignment operator
- > int ttime[6]={0,0,0,0,0,0};
- > -----------------------------^
- >ccom: Error: tr.c, line 12: illegal lhs of assignment operator
- > int ttime[6]={0,0,0,0,0,0};
- > -------------------------------^
- >"
- This looks perfect. This should probably u would have left something
- in your program. This works for me.
- Try giving blanks between '0' and `,`.
-
-
- > I really don't see what is wrong, the more because in my c-book,
- > "C by discovery" by L.S. Foster on page 213, almost exactly the
- > same thing is done.
-
- read K&R c book chapter on Arrays.
-
- Prasad V Narsipur.
-
- >Thanks a lot in advance for any answer and I am sorry if the UNIX question
- >doesn't belong in this newsgroup.
- >
- >Regards,
- >
- >Wimjan
- >
- >kugold@kuhub.cc.ukans.edu
-
-
-