📄 demo_type_cast_4_reinterpret_cast_1.cpp
字号:
//**********************************************
// reinterpret_cast操作符进行指针之间类型转换
//**********************************************
# include <iostream.h>
# include <string.h>
# include <malloc.h>
int main()
{
// char* cp=(char *)malloc(100);
char* cp=reinterpret_cast<char *>(malloc(100));
strcpy(cp,"Hello, Guys!");
cout<<cp<<endl;
free(cp);
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -