当前位置:网站首页>从cmath文件看名字是怎样被添加到命名空间std中的
从cmath文件看名字是怎样被添加到命名空间std中的
2022-07-07 23:29:00 【昊虹图像算法】
std为C++中的标准命名空间,C++的标准库中的各种名字都在其中。
下面是一个使用标准命名空间std的例子。
#include <cmath>
#include <iostream>
using namespace std;
int main()
{
float x = 3.6;
int y = round(x);
cout << "y is:" << y << endl << endl;
}
运行结果如下:
在上面这个代码中,名字round、cout、endl都是std空间中的名字。
标准库math中的函数名也被添加到了std空间中,
文件cmath的百度网盘下载链接:
https://pan.baidu.com/s/1NZClfWR5ARG0WNdOOe0mZQ?pwd=wb7i
接下来我们看下cmath文件是怎么把math中的函数名字引入到std空间中的。
截图如下:
从上面的截图中我们可以看出,将名字引入std空间,
起始语句为:
_STD_BEGIN
如果我们要把名字abs引入std空间,则像下面这样写:
using _CSTD abs;
把要添加入名字写完后,按下面这样结尾:
从上面的截图中可以看出,以
_STD_END
结尾。
大概就这样。
边栏推荐
- Multi purpose signal modulation generation system based on environmental optical signal detection and user-defined signal rules
- Call (import) in Jupiter notebook ipynb . Py file
- Kafka-connect将Kafka数据同步到Mysql
- COMSOL----微阻梁模型的搭建---最终的温度分布和变形情况----几何模型的建立
- NPM internal split module
- Chapter IV decision tree
- How to write mark down on vscode
- Euler Lagrange equation
- redis的持久化方式-RDB和AOF 两种持久化机制
- Taiwan Xinchuang sss1700 latest Chinese specification | sss1700 latest Chinese specification | sss1700datasheet Chinese explanation
猜你喜欢

High quality USB sound card / audio chip sss1700 | sss1700 design 96 kHz 24 bit sampling rate USB headset microphone scheme | sss1700 Chinese design scheme explanation

3、多智能体强化学习

Chapter 5 neural network

The beauty of Mathematics -- the principle of fine Fourier transform

Led serial communication

Vs code configuration latex environment nanny level configuration tutorial (dual system)

2022 high altitude installation, maintenance and demolition examination materials and high altitude installation, maintenance and demolition operation certificate examination

Blue Bridge Cup embedded (F103) -1 STM32 clock operation and led operation method

2022 tea master (intermediate) examination questions and tea master (intermediate) examination skills

Design method and reference circuit of type C to hdmi+ PD + BB + usb3.1 hub (rj45/cf/tf/ sd/ multi port usb3.1 type-A) multifunctional expansion dock
随机推荐
2022 chemical automation control instrument examination summary and chemical automation control instrument simulation examination questions
Cs5261type-c to HDMI alternative ag9310 | ag9310 alternative
5、离散控制与连续控制
Gnuradio 3.9 using OOT custom module problem record
Common operations of numpy on two-dimensional array
QT--创建QT程序
How does Matplotlib and PIL image integrate and save multiple pictures into one picture
Multi purpose signal modulation generation system based on environmental optical signal detection and user-defined signal rules
Taiwan Xinchuang sss1700 latest Chinese specification | sss1700 latest Chinese specification | sss1700datasheet Chinese explanation
2022 free test questions of fusion welding and thermal cutting and summary of fusion welding and thermal cutting examination
Basic realization of line graph
Guojingxin center "APEC investment +": some things about the Internet sector today | observation on stabilizing strategic industrial funds
Call (import) in Jupiter notebook ipynb . Py file
The difference between distribution function and probability density function of random variables
Coordinate conversion of one-dimensional array and two-dimensional matrix (storage of matrix)
npm 內部拆分模塊
Generic configuration legend
Ag9310 for type-C docking station scheme circuit design method | ag9310 for type-C audio and video converter scheme circuit design reference
Authorization code of Axure rp9
Cs5212an design display to VGA HD adapter products | display to VGA Hd 1080p adapter products