Advertisement
Guest User

Untitled

a guest
Dec 11th, 2015
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. app1:
  2.  
  3. #include <iostream>
  4.  
  5. int main(int, char *[])
  6. {
  7. std::string s;
  8. while (1)
  9. {
  10. std::cin >> s;
  11. std::cout << s;
  12. }
  13.  
  14. return 0;
  15. }
  16.  
  17. app2 (Qt):
  18.  
  19. #include <QProcess>
  20.  
  21. int main(int, char *[])
  22. {
  23. QProcess p;
  24. p.start("/home/my/dev/build-app2-Desktop_Qt_5_5_1_GCC_64bit-Debug/app2");
  25. for (quint64 i = 0; i < 100000; i++)
  26. p.write("0000000000000000000000000000000000000000000000000000000\n");
  27.  
  28.  
  29. QString s = p.readAllStandardOutput(); //crash after this called
  30.  
  31.  
  32. return 0;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement