Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. #include <iostream>
  2. #include<thread>
  3.  
  4. using namespace std;
  5.  
  6. class Aviao{
  7. public:
  8.  
  9. int vel = 0;
  10.  
  11. void imprime(){ cout << "imressões";} // meu método
  12. };
  13.  
  14. int main(){
  15.  
  16. Aviao *av1=new Aviao();
  17.  
  18. thread first(meu_método_imprime()_aqui); // meu método dentro da thread
  19.  
  20. first.detach();
  21. return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement