SHARE
TWEET

Untitled

a guest May 19th, 2017 40 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2.  
  3. #include <nxt.h>
  4. #include <stdio.h>
  5. #include <unistd.h>
  6. #include <string.h>
  7. #include <stdlib.h>
  8.  
  9. int main() {
  10.   char *name = NULL;
  11.   char msg[100];
  12.   int box = 0;
  13.   int c;
  14.   char mee;
  15.   nxt_init();
  16.   nxt_t *nxt = nxt_open(name);
  17.   if (nxt==NULL) c=0;
  18.   else c=1;
  19.   printf("Quelle mailbox ?\n");
  20.   scanf("%d", &box);
  21.   printf("Quelle message ?\n");
  22.   scanf("%c", &mee);
  23.   sprintf(msg,"%s",mee);
  24.   if (nxt_sendmsg(nxt,box,msg)==-1) fprintf(stderr,"Error: %s\n",nxt_strerror(nxt_error(nxt)));
  25.   int ret = nxt_error(nxt);
  26.   if (name!=NULL) free(name);
  27.   nxt_close(nxt);
  28.  
  29.   return ret;
  30. }
RAW Paste Data
Want to get better at C++?
Learn to code C++ in 2017
Top