#include <Windows.h>
#include <cstdio>

struct Arith
{
    void arithmetic()
	{
		std::printf("unko\n");
	}

	static DWORD __stdcall thread_entry_point(VOID *param)
	{
		auto *pa = static_cast<Arith *>(param);
		pa->arithmetic();

		return 0;
	}
};

int main()
{
	auto *pa = new Arith;
	DWORD tid;
	auto h = ::CreateThread(nullptr, 0, Arith::thread_entry_point, pa, 0, &tid);
	if ( h == nullptr )
		throw "oops...";
	std::printf("[main] started\n");
	::WaitForSingleObject(h, INFINITE);
	std::printf("[main] joined\n");
}
