Horje
c++ thread incide class Code Example
c++ thread incide class
#include <iostream>
#include <thread>

class foo
{
public:
    void make_foo_func_thread()
    {
        t=std::thread(&foo::foo_func, this);
        t.join();
    }

private:
    std::thread t;
    void foo_func() { std::cout << "Hello\n"; }
};

int main()
{
    foo f;
    f.make_foo_func_thread();
}




Cpp

Related
print  pattern and space in cpp Code Example print pattern and space in cpp Code Example
cpp loop through object Code Example cpp loop through object Code Example
generate random string in c++ Code Example generate random string in c++ Code Example
life the universe and everything solution c++ Code Example life the universe and everything solution c++ Code Example
bash find into array Code Example bash find into array Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7