initial ideas
This commit is contained in:
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
build
|
||||
26
main.c
Normal file
26
main.c
Normal file
@@ -0,0 +1,26 @@
|
||||
#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;
|
||||
}
|
||||
Reference in New Issue
Block a user