ThreadMe クラスの thefunction() という名前の関数のメイン関数にスレッドを作成しようとしています。トリッキーな部分は、別のクラス TYIA でスレッドを開始する必要があることです - Roland
#include <iostream>
#include <process.h>
#include <windows.h>
int main() {
char cincatcher[24];
std::cout << "I want to run a thread using a function on another class\n";
// Here is a good place to start the thread
while( true ) {
std::cin >> cincatcher
}
}
class ThreadMe {
void thefunction();
};
void ThreadMe::thefunction() {
while( true ) {
std::cout << "working!\n"
Sleep(800);
}
}