当前位置:网站首页>从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
结尾。
大概就这样。
边栏推荐
- Smart agricultural technology framework
- Basic realization of line graph
- How to transfer Netease cloud music /qq music to Apple Music
- About snake equation (2)
- Call (import) in Jupiter notebook ipynb . Py file
- Understanding of sidelobe cancellation
- 2022 tea master (intermediate) examination questions and tea master (intermediate) examination skills
- Recommend a document management tool mendely Reference Manager
- 5、离散控制与连续控制
- Frequency probability and Bayesian probability
猜你喜欢

2022 safety officer-c certificate examination paper and safety officer-c certificate simulated examination question bank

Two methods for full screen adaptation of background pictures, background size: cover; Or (background size: 100% 100%;)

Chapter 7 Bayesian classifier

Recommend a document management tool Zotero | with tutorials and learning paths

Capstone/cs5210 chip | cs5210 design scheme | cs5210 design data

2021-03-06 - play with the application of reflection in the framework

Chapter 16 intensive learning

Ag9311maq design 100W USB type C docking station data | ag9311maq is used for 100W USB type C to HDMI with PD fast charging +u3+sd/cf docking station scheme description

4、策略學習

Design method and application of ag9311maq and ag9311mcq in USB type-C docking station or converter
随机推荐
Gnuradio operation error: error thread [thread per block [12]: < block OFDM_ cyclic_ prefixer(8)>]: Buffer too small
Ag9310 design USB type C to hdmi+u2+5v slow charging scheme design | ag9310 expansion dock scheme circuit | type-C dongle design data
Guojingxin center "APEC education +" Shanghai Jiaotong University Japan Cooperation Center x Fudan philosophy class "Zhe Yi" 2022 New Year greetings
Frrouting BGP protocol learning
Getting started STM32 -- how to learn stm32
Gnuradio transmits video and displays it in real time using VLC
Kindle operation: transfer downloaded books and change book cover
Parade ps8625 | replace ps8625 | EDP to LVDS screen adapter or screen drive board
COMSOL----微阻梁模型的搭建---最终的温度分布和变形情况----几何模型的建立
Ag9311maq design 100W USB type C docking station data | ag9311maq is used for 100W USB type C to HDMI with PD fast charging +u3+sd/cf docking station scheme description
common commands
Blue Bridge Cup embedded (F103) -1 STM32 clock operation and led operation method
On the concept and application of filtering in radar signal processing
Ag9310meq ag9310mfq angle two USB type C to HDMI audio and video data conversion function chips parameter difference and design circuit reference
Leetcode notes No.21
About snake equation (2)
2022 free test questions of fusion welding and thermal cutting and summary of fusion welding and thermal cutting examination
Common configurations in rectangular coordinate system
Kaptcha generates verification code on Web page
Ag9310 same function alternative | cs5261 replaces ag9310type-c to HDMI single switch screen alternative | low BOM replaces ag9310 design