home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!moe.ksu.ksu.edu!kuhub.cc.ukans.edu!kugold
- From: kugold@kuhub.cc.ukans.edu
- Newsgroups: comp.lang.c
- Subject: Few simple questions
- Message-ID: <1993Jan21.001022.46578@kuhub.cc.ukans.edu>
- Date: 21 Jan 93 00:10:21 CST
- Organization: University of Kansas Academic Computing Services
- Lines: 61
-
- 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};
- -------------------------------^
- "
-
- 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.
-
- 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
-