26 lines
493 B
C
26 lines
493 B
C
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
|
|
#ifdef _WIN32
|
|
#include <windows.h>
|
|
#define sleep_ms(ms) Sleep(ms)
|
|
#else
|
|
#include <unistd.h>
|
|
#define sleep_ms(ms) usleep((ms) * 1000)
|
|
#endif
|
|
|
|
int main() {
|
|
char *buffer = NULL;
|
|
size_t buffsize = 0;
|
|
ssize_t characters;
|
|
|
|
printf("What do you worry about? \n");
|
|
characters = getline(&buffer, &buffsize, stdin);
|
|
|
|
if (characters != -1) {
|
|
printf("you typed %s\n", buffer);
|
|
}
|
|
|
|
sleep_ms(500);
|
|
return 0;
|
|
} |