当前位置:网站首页>从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
结尾。
大概就这样。
边栏推荐
- 2021-04-12 - new features lambda expression and function functional interface programming
- Matlab code on error analysis (MAE, MAPE, RMSE)
- Basic realization of line graph
- Common operations of numpy on two-dimensional array
- Ag9310 design USB type C to hdmi+u2+5v slow charging scheme design | ag9310 expansion dock scheme circuit | type-C dongle design data
- 2022 R1 fast opening pressure vessel operation test question bank and R1 fast opening pressure vessel operation free test questions
- Generic configuration legend
- How to write mark down on vscode
- Redis cluster
- After modifying the background of jupyter notebook and adding jupyterthemes, enter 'JT -l' and the error 'JT' is not an internal or external command, nor a runnable program
猜你喜欢

Redis 主从复制

2022 examination for safety production management personnel of hazardous chemical production units and new version of examination questions for safety production management personnel of hazardous chem

redis的持久化方式-RDB和AOF 两种持久化机制

5. Discrete control and continuous control

Cs5261type-c to HDMI alternative ag9310 | ag9310 alternative

Matlab code about cosine similarity

Probability distribution

Macro definition and multiple parameters

5、离散控制与连续控制

The communication clock (electronic time-frequency or electronic time-frequency auxiliary device) writes something casually
随机推荐
Understanding of prior probability, posterior probability and Bayesian formula
Arm bare metal
Study notes of single chip microcomputer and embedded system
5、離散控制與連續控制
Gnuradio operation error: error thread [thread per block [12]: < block OFDM_ cyclic_ prefixer(8)>]: Buffer too small
Gnuradio 3.9 using OOT custom module problem record
Definition and classification of energy
2022 R1 fast opening pressure vessel operation test question bank and R1 fast opening pressure vessel operation free test questions
Kuntai ch7511b scheme design | ch7511b design EDP to LVDS data | pin to pin replaces ch7511b circuit design
Gnuradio transmits video and displays it in real time using VLC
Common effects of line chart
Different methods for setting headers of different pages in word (the same for footer and page number)
Leetcode notes No.7
Gnuradio3.9.4 create OOT module instances
Know how to get the traffic password
Recommend a document management tool mendely Reference Manager
The solution of frame dropping problem in gnuradio OFDM operation
Getting started STM32 -- how to learn stm32
2021-03-14 - play with generics
Guojingxin center "friendship and righteousness" - the meta universe based on friendship and friendship, and the parallel of "honguniverse"