daily pastebin goal
43%
SHARE
TWEET

Untitled

a guest Aug 18th, 2018 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2. #include "uv.h"
  3. static void cb(uv_write_t* req, int status) {
  4.   printf("Hello from Callback.\n");
  5.   uv_unref(uv_default_loop());
  6. }
  7. int main() {
  8.   uv_tty_t tty;
  9.   uv_write_t req;
  10.   int ret = uv_tty_init(uv_default_loop(), &tty, 1, 0);
  11.   uv_buf_t bufs[] = {uv_buf_init("Hello UV!\n",10)};
  12.   ret = uv_write(&req, (uv_stream_t*)&tty, bufs, 1, cb);
  13.   uv_run(uv_default_loop());
  14.   return 0;
  15. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top