This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

About C/getch()




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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]