Как можно очистить экран, используя Си, функция clrscr () работает только на виндовских компиляторах, пока не нашел альтернативы ее для unix компиляторов, буду благодарен за информацию.
Два балла за такой совет! Причем гугл ищет ответ на раз. Вот например,
http://www.sslug.dk/emailarkiv/cprog/1999_01/msg00010.html /************************************************************************* * * 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 */ }
/*************************************************************************
*
* 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
*/
}
Стопудово, спасибо за нпоминание. А-то у меня после 15 часов мозгового штурма уже голова пухнет. Вижу знакомые символы и не понимаю, где я их мог видеть... : )