当前位置:网站首页>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 ;
边栏推荐
- Moonbeam integrates coin98, giving users more choices on the multi chain road
- Pager when importing text files from MySQL
- UI automation test framework construction - write an app automation
- Has anyone ever used CDC to synchronize to MySQL with a deadlock?
- Web3来临时的风口浪尖
- Multithreading and high concurrency II: detailed introduction to volatile and CAS
- Multithreading and high concurrency six: source code analysis of thread pool
- 10:00面试,10:02就出来了 ,问的实在是太...
- Aspnetcoreratelimit rate limit interface access limit current limit control
- 100+数据科学面试问题和答案总结 - 机器学习和深度学习
猜你喜欢

Why is the frame rate calculated by opencv wrong?

Annual comprehensive analysis of China's audio market in 2022

A doctor's 22 years in Huawei (full of dry goods)

代码理解:IMPROVING CONVOLUTIONAL MODELS FOR HANDWRITTEN TEXT RECOGNITION

Performance optimization and implementation of video codec

JVM I: introduction to JVM and understanding of class files

Pager when importing text files from MySQL
![[noip2002 popularization group] cross the river pawn](/img/6c/31fa210e08c7fd07691a1c5320154e.png)
[noip2002 popularization group] cross the river pawn

【Matlab红绿灯识别】红绿灯识别【含GUI源码 1908期】

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
随机推荐
Google Earth engine (GEE) - global flood database V1 (2000-2018)
From meeting a big guy to becoming a big guy, shengteng AI developer creation day brings infinite possibilities to developers
Project practice! Teach you JMeter performance test hand in hand
A queue of two stacks
Are test / development programmers really young? The world is fair. We all speak by strength
Multithreading and high concurrency V: detailed explanation of wait queue, executor and thread pool (key)
阿里P8倾情推荐,Fiddler抓包工具实战篇(一)
Has anyone ever used CDC to synchronize to MySQL with a deadlock?
论文详读:IMPROVING CONVOLUTIONAL MODELS FOR HANDWRITTEN TEXT RECOGNITION
LeetCode 88:合并两个有序数组
How can we speed up the chunksplitter when CDC extracts MySQL data in full?
Bitlock recovery occurs in win 10, and the blue screen error code is 0x1600007e
xml  File read / write
有大佬出现过mysql cdc用 datastream时,出现重复binlog消息的情况吗
Annual comprehensive analysis of China's audio market in 2022
[csp-j2020] excellent splitting
leetcode:714. The best time to buy and sell stocks includes handling fee [DP dual status]
Severe tire damage: the first rock band in the world to broadcast live on the Internet
With the transformation of automatic empowerment, Feihe dairy accelerates its move towards digitalization!
Has any boss ever seen repeated binlog messages when MySQL CDC uses datastream