More getch() woes
Jon Eric Strayer
Jon.Eric.Strayer at p3.f270.n231.z1.Fidonet.Org
Tue Mar 19 01:07:27 AEST 1991
Marc WANDSCHNEIDER writes to All:
The following program WITHOUT The line #include <conio.h> does not
work. It just freezes the entire system up, and I have to reboot (usin TC++
1.0 on a PC). However, when I put the #include <conio.h>> line in, it
doesn't even compile. I get LValue required in function main, and it point
to the line c = 0;
#include <stdio.h>
#include <conio.h>
main()
{
int i, test, c[25];
i = 0;
c = 0;
while ((i < 25) || (test !='A')) {
test = getch();
c[i++] = test;
}
printf("\n\n %s", c);
return 0;
}
Any insight...?
--------------------------------
I get the same result (Lvalue required) with or without includeing conio.h.
I'm using TC++ 1.01, so that may be the reasong for differing results. But I
don't see how you can be getting the above to compile in any case. If you
want to assign zero to each element of an array you have to do just that.
* Origin: Point No Point (Lebanon, IN) (1:231/270.3)
More information about the Comp.lang.c
mailing list