c++ string to char

int MyPlayTread2(const char* name)
{
	cout << name << endl;
	return 0;
}

	string s = "string";
	s += " suo";
	char* a = new char[s.size() + 1];
	a[s.size()] = 0;
	memcpy(a, s.c_str(), s.size());

CreateThread(0, 0,
		(LPTHREAD_START_ROUTINE)MyPlayTread2, (LPVOID)a,
		0, 0)
posted @ 2020-08-04 09:32  Ajanuw  阅读(287)  评论(0编辑  收藏  举报