当前位置:网站首页>Differences between pragma and ifndef
Differences between pragma and ifndef
2022-06-28 04:50:00 【Lzg_ n】
First #pragma once It's compiler related , Some compilers support , Some compilers don't support
1、#ifndef The method depends on the macro name and cannot conflict , So this ensures that the same file will not be included more than once , It also ensures that multiple copies of files will not be included at the same time ;
The disadvantage is that if the macro names of different content header files are not careful “ Car crash ”, The compiler can only contain one of them ;
2、#pragma once Is guaranteed by the compiler : The same file will not be compiled more than once . Pay attention to what's said here “ The same file ” It's a physical file ;
Weakness is , There are multiple copies of a header file , This method cannot guarantee that they are not included repeatedly .
3、 Sum up ,#ifndef Ensure that the macro name does not duplicate ;
#pragma once Ensure that the physical files are not duplicated ;
边栏推荐
- Taco: a data enhancement technique for character recognition
- 云厂商为什么都在冲这个KPI?
- JS reverse massive star map sign signature
- To quickly download JDK, in addition to the official Oracle download, is there a download address for the latest version available in China
- 穿越封锁的最新利器,速度最快梯没有之一。
- The growth summer challenge is coming | learn and create two major tracks, and start the tutor registration!
- MySQL gets the current date of the year
- 政策利好,20多省市开启元宇宙发展规划
- From meeting a big guy to becoming a big guy, shengteng AI developer creation day brings infinite possibilities to developers
- inherit
猜你喜欢

native关键字的作用
![[noip2002 popularization group] cross the river pawn](/img/6c/31fa210e08c7fd07691a1c5320154e.png)
[noip2002 popularization group] cross the river pawn

100+数据科学面试问题和答案总结 - 机器学习和深度学习

The company leader said that if the personal code exceeds 10 bugs, he will be dismissed. What is the experience?
![[csp-j2020] excellent splitting](/img/05/90f9cf71791b3cdc37073eaf5db989.png)
[csp-j2020] excellent splitting

Audio and video technology development weekly

Huawei's 9-year experience as a software testing director

Where does the storm go? Whose pot is the weather forecast wrong?

政策利好,20多省市开启元宇宙发展规划

27 years, Microsoft IE is over!
随机推荐
Resolve cross domain
Design a stack with getmin function
[applet] solution document using font awesome Font Icon (picture and text)
知识点滴 - 关于汉语学习的网络资源
mysql修改密码报错需要怎么做
Mise en place d'un cadre d'essai d'automatisation de l'interface utilisateur - - rédaction d'une application d'automatisation
If mysqlcdc sets multiple parallelism, will the incremental data repeat?
灵活的IP网络测试工具——— X-Launch
Is it true that qiniu business school gives away securities accounts? Is it safe to open an account
June 27, 2022: give a 01 string with a length of N. now please find two intervals so that the number of 1 and the number of 0 in the two intervals are equal. The two intervals can intersect, but not c
Array method
Multi thread implementation rewrites run (), how to inject and use mapper file to operate database
阿里P8倾情推荐,Fiddler抓包工具实战篇(一)
A bit of knowledge - online resources on Chinese Learning
政策利好,20多省市开启元宇宙发展规划
Are test / development programmers really young? The world is fair. We all speak by strength
请问下,mysqlcdc设置多并行度的话,增量数据是不是会重复?
Lazy loading and preloading of pictures
xml  File read / write
Go语言学习教程(十四)