Advertisement
Guest User

Untitled

a guest
Mar 19th, 2019
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. int conn()
  2. {
  3. char c[1000];
  4. FILE *fptr;
  5.  
  6. if ((fptr = fopen("contact.txt", "r")) == NULL)
  7. {
  8. printf("Error! opening file");
  9. // Program exits if file pointer returns NULL.
  10. exit(1);
  11. }
  12.  
  13. // reads text until newline
  14. fscanf(fptr,"%[^\n]", c);
  15.  
  16. printf("Data from the file:\n%s", c);
  17. pbtelnet(c, "23");
  18. fclose(fptr);
  19.  
  20. return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement