Over a million developers have joined DZone.

C - Clear Screen

·
// 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.

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

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

{{ parent.tldr }}

{{ parent.urlSource.name }}