Files
Module_connection/module_04.c

21 lines
608 B
C
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#include <stdio.h>
#include <unistd.h> // для usleep
#include <string.h> // для strlen
int module_04_run() {
const char *text = " Permission denied.";
const char *red = "\033[1;31m";
const char *reset = "\033[0m";
printf("%s", red); // включаем красный
for (size_t i = 0; i < strlen(text); i++) {
printf("%c", text[i]);
fflush(stdout); // выводим сразу
usleep(100000); // задержка 0.1 секунды
}
printf("%s\n", reset); // сброс цвета и перенос строки
return 0;
}