[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [CPROG] GCC och ANSI !



Johan Andersson wrote:
> 
> Joachim Holst wrote:
> >
> > Hejsan !
> >
> > Jag har alltid fått för mig att GCC och libc6 följer ANSI standarden när det
> > gäller C. Har nu stött på en sak i en bok Grunderna i C av Ingvar Gratte som
> > heter getch() och en som heter getche() och som lär finnas i conio.h.
> >
> 
> Filen conio.h finns inte i Linux, inte i någon GNU-kompilator, har kollat själv i >djgpp, Cygnus, men den finns inte. De
> enda som den finnssom jag hittat är till windows och är:  borland C++ och Visual >C++
>

Du kan lave din egen conio.h hvis det er:

Den kunne se ud som følger:

/*************************************************************************
 *
 * Purpose: Clear the screen with VT100 escape codes. This can be done
 *          with conio.h on PCs - non standard code. Or curses.h, bit of 
 *          a fag...
 * Author:  M.J. Leslie
 * Date:    22-Jun-94
 *

************************************************************************/

void clrscr(void);

main()
{
  clrscr();
}

void clrscr(void)
{
  char a[80];
  printf("\033[2J");            /* Clear the entire screen.            
*/
  printf("\033[0;0f");          /* Move cursor to the top left hand
corner */
}

---
Så har du clrscr funktionen og getche() kan du erstatte med getchar(),
det har virket for mig indtil videre...

Check denne URL for yderligere information:
http://www.math-cs.upei.ca/misc/cref/C/master_index.html

 
> > Jag undrar om dessa ingår i ANSI standarden och i så fall om någon kan svara på
> > varför de verkar saknas i Linux....
> >
> >  --
> >
> > /Jocke
> >

-- 
Jonas B. Nielsen

Eml: sslug@sslug
Tel: 45257449


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 20:07 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *