2016-12-01から1日間の記事一覧
返り値に代わる変数を渡せばいいじゃない。 #include <thread> #include <stdio.h> int th(int* ret) { printf("1"); ret = 1; return 1; } int main() { int ret; std::thread th(th, &ret); th.join(); return 0; } ね、簡単でしょ。</stdio.h></thread>
返り値に代わる変数を渡せばいいじゃない。 #include <thread> #include <stdio.h> int th(int* ret) { printf("1"); ret = 1; return 1; } int main() { int ret; std::thread th(th, &ret); th.join(); return 0; } ね、簡単でしょ。</stdio.h></thread>