📄 cast.cpp
字号:
// cast.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
using namespace std;
int main(int argc, char* argv[])
{
// static_cast
float f=5.5 ;
int n=static_cast<int>(6.7) ;
cout<<n<<endl;
// reinterpret_cast
#if 0
// int *p=static_cast<int*>(n);
int *p=reinterpret_cast<int*>(n);
cout<<p<<endl;
int n1=reinterpret_cast<int>(p);
cout<<p<<endl;
#endif
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -