Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

C - Clear Screen

DZone's Guide to

C - Clear Screen

·
Free Resource
// Simula il comportamente di clear/cls


#include 
  
   
#include 
   
    

int main(int argc, char *argv[])
{
	// Funziona sui terminali compatibili ansi
	
	fprintf(stdout, "\033[2J"); // Cancella lo schermo
	fprintf(stdout, "\033[1;1H"); // Posiziona il cursore sulla linea colonna 1

	return EXIT_SUCCESS;
}

   
  
Topics:

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}