当前位置:网站首页>从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
结尾。
大概就这样。
边栏推荐
- NPM Internal Split module
- Taiwan Xinchuang sss1700 latest Chinese specification | sss1700 latest Chinese specification | sss1700datasheet Chinese explanation
- Chapter improvement of clock -- multi-purpose signal modulation generation system based on ambient optical signal detection and custom signal rules
- About how USRP sets the sampling frequency below the minimum sampling frequency reached by the hardware
- HDMI to VGA acquisition HD adapter scheme | HDMI to VGA 1080p audio and video converter scheme | cs5210 scheme design explanation
- Macro definition and multiple parameters
- Two methods for full screen adaptation of background pictures, background size: cover; Or (background size: 100% 100%;)
- Different methods for setting headers of different pages in word (the same for footer and page number)
- break net
- Guojingxin center "friendship and righteousness" - the meta universe based on friendship and friendship, and the parallel of "honguniverse"
猜你喜欢
Generic configuration legend
Chapter 5 neural network
Scheme selection and scheme design of multifunctional docking station for type C to VGA HDMI audio and video launched by ange in Taiwan | scheme selection and scheme explanation of usb-c to VGA HDMI c
Share a latex online editor | with latex common templates
Blue Bridge Cup embedded (F103) -1 STM32 clock operation and led operation method
General configuration title
HDMI to VGA acquisition HD adapter scheme | HDMI to VGA 1080p audio and video converter scheme | cs5210 scheme design explanation
Ag9310 same function alternative | cs5261 replaces ag9310type-c to HDMI single switch screen alternative | low BOM replaces ag9310 design
Know how to get the traffic password
Redis 主从复制
随机推荐
Call (import) in Jupiter notebook ipynb . Py file
break net
Leetcode notes No.7
The examination contents of the third batch of Guangdong Provincial Safety Officer a certificate (main person in charge) in 2021 and the free examination questions of the third batch of Guangdong Prov
Definition and classification of energy
2021-03-14 - play with generics
Deep learning website
Common configurations in rectangular coordinate system
2021-03-06 - play with the application of reflection in the framework
2、TD+Learning
General configuration title
Chapter 16 intensive learning
2021 tea master (primary) examination materials and tea master (primary) simulation test questions
Recommend a document management tool Zotero | with tutorials and learning paths
Arm bare metal
Frequency probability and Bayesian probability
2022 high altitude installation, maintenance and demolition examination materials and high altitude installation, maintenance and demolition operation certificate examination
2022 new examination questions for crane driver (limited to bridge crane) and question bank for crane driver (limited to bridge crane) operation examination
Scalar / vector / matrix derivation method
Cs5261type-c to HDMI alternative ag9310 | ag9310 alternative