This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
About C/getch()
- To: gcc at gcc dot gnu dot org
- Subject: About C/getch()
- From: JN_Lin at utc dot com dot tw
- Date: Fri, 1 Oct 1999 09:00:07 +0800
Dear :
I'm compile my C's program , but it show error , below
===================================================================================
In file included from /usr/include/curses.h:23,
from /usr/local/lib/gcc-lib/i386-pc-solaris2.7/2.95.1/include/,
from z.c:1:
/usr/include/widec.h:42: warning: `getwc' redefined
/usr/include/wchar.h:326: warning: this is the location of the previous definitn
/usr/include/widec.h:43: warning: `putwc' redefined
/usr/include/wchar.h:329: warning: this is the location of the previous definitn
/usr/include/widec.h:44: warning: `getwchar' redefined
/usr/include/wchar.h:327: warning: this is the location of the previous definitn
/usr/include/widec.h:45: warning: `putwchar' redefined
/usr/include/wchar.h:330: warning: this is the location of the previous definitn
===================================================================================
and below is my program
----------------------------------------------------------------------------------------------------------------------------------------------
#include <curses.h>
#include <stdio.h>
main()
{
char a=0 , str[255]="\0" ;
int i = 0 ;
while(a != '\n')
{
//a=fgetc(stdin) ;
//fputc(a,stdout);
a=getch();
str[i++]=a ;
}
printf("%s" , str) ;
}
----------------------------------------------------------------------------------------------------------------------------------------------
Thanks
J.N . Lin