The conversion between c++ char and char* is carried out through the char array

#include <iostream>
using namespace std;


int main()
{
	char buf[5] = { 'a','b','c','d','e' };
	char* p = new char[5];
	p = buf;
}

 

Guess you like

Origin blog.csdn.net/dxm809/article/details/115266866