Skip to content

Commit 618b551

Browse files
author
Colin Robertson
authored
Merge pull request #2089 from compnerd/patch-1
Update welcome-back-to-cpp-modern-cpp.md
2 parents c90f095 + e0a2c33 commit 618b551

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/cpp/welcome-back-to-cpp-modern-cpp.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ int main()
138138
Macros in C and C++ are tokens that are processed by the preprocessor before compilation. Each instance of a macro token is replaced with its defined value or expression before the file is compiled. Macros are commonly used in C-style programming to define compile-time constant values. However, macros are error-prone and difficult to debug. In modern C++, you should prefer [constexpr](constexpr-cpp.md) variables for compile-time constants:
139139

140140
```cpp
141-
#define SIZE 10 / C-style
141+
#define SIZE 10 // C-style
142142
constexpr int size = 10; // modern C++
143143
```
144144

0 commit comments

Comments
 (0)