当前位置:网站首页>从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
结尾。
大概就这样。
边栏推荐
- qt-使用自带的应用框架建立--hello world--使用min GW 32bit
- 2022 tea master (intermediate) examination questions and tea master (intermediate) examination skills
- Common fault analysis and Countermeasures of using MySQL in go language
- Two methods for full screen adaptation of background pictures, background size: cover; Or (background size: 100% 100%;)
- Basic realization of line chart (II)
- LeetCode 练习——剑指 Offer 36. 二叉搜索树与双向链表
- Common effects of line chart
- Smart grid overview
- Application of state mode in JSF source code
- The beauty of Mathematics -- the principle of fine Fourier transform
猜你喜欢

qt--将程序打包--不要安装qt-可以直接运行

The communication clock (electronic time-frequency or electronic time-frequency auxiliary device) writes something casually

2022 tea master (intermediate) examination questions and tea master (intermediate) examination skills
![Gnuradio operation error: error thread [thread per block [12]: < block OFDM_ cyclic_ prefixer(8)>]: Buffer too small](/img/ab/066923f1aa1e8dd8dcc572cb60a25d.jpg)
Gnuradio operation error: error thread [thread per block [12]: < block OFDM_ cyclic_ prefixer(8)>]: Buffer too small

Understanding of maximum likelihood estimation

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

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

Several frequently used OCR document scanning tools | no watermark | avoid IQ tax

Ag7120 and ag7220 explain the driving scheme of HDMI signal extension amplifier | ag7120 and ag7220 design HDMI signal extension amplifier circuit reference

Kindle operation: transfer downloaded books and change book cover
随机推荐
How to write mark down on vscode
Basic realization of line chart (II)
npm 內部拆分模塊
On the concept and application of filtering in radar signal processing
Markdown learning (entry level)
Design method and application of ag9311maq and ag9311mcq in USB type-C docking station or converter
common commands
Cs5261type-c to HDMI alternative ag9310 | ag9310 alternative
Share a latex online editor | with latex common templates
Connect to the previous chapter of the circuit to improve the material draft
Several frequently used OCR document scanning tools | no watermark | avoid IQ tax
Codeforces Round #804 (Div. 2)
Gnuradio3.9.4 create OOT module instances
The beauty of Mathematics -- the principle of fine Fourier transform
How to use education discounts to open Apple Music members for 5 yuan / month and realize member sharing
写一个纯手写的qt的hello world
2022 tea master (intermediate) examination questions and tea master (intermediate) examination skills
Guojingxin center "APEC investment +": some things about the Internet sector today | observation on stabilizing strategic industrial funds
5、離散控制與連續控制
Arm bare metal